@gilbert
To remove arrow functions from webpack output, you can use the babel-loader with the babel-plugin-transform-arrow-functions plugin. Here's how you can configure webpack to remove arrow functions:
1
|
npm install babel-loader @babel/core @babel/preset-env babel-plugin-transform-arrow-functions --save-dev |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
module: {
rules: [
{
test: /.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: ['transform-arrow-functions']
}
}
}
]
}
|
With this configuration, webpack will use babel-loader to transpile your JavaScript code and remove arrow functions from the output.