Im trying to compile following code:
// src/index.tsx
console.log(() => {})
When I use "target": "es6"
in tsconfig
I get following code (all ok):
(()=>{"use strict";console.log((()=>{}))})();
But when I use "target": "es3"
in tsconfig
the generated code still contains SOME arrow functions (that arent supported in ES3):
(()=>{"use strict";console.log((function(){}))})();
What's the point of transpiling just my code but not the own webpack generated one?
This is my webpack config:
module.exports = {
mode: "development",
devtool: "inline-source-map",
entry: "./src/index.tsx",
output: {
filename: "webpackbundle.js"
},
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: [".ts", ".tsx", ".js"]
},
module: {
rules: [
// all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
{ test: /\.tsx?$/, loader: "ts-loader" }
]
}
};