I'm currently facing an issue with converting arrow functions to work on Internet Explorer using babel and webpack. Despite my efforts, I haven't been able to get it functioning properly.
Here are the dev dependencies listed in my package.json file:
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-env": "^1.7.0",
"webpack": "^3.12.0",
"webpack-cli": "^3.1.0"
}
This is how my webpack.config.js looks like:
module.exports = {
entry: ['./chat.js'],
devtool: 'source-map',
output: {
path: path.resolve(__dirname, "dist"),
filename: "chat.js"
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}
]
}
};
The plugins being used are listed in .babelrc:
{
"presets": ["env"],
"plugins": ["transform-class-properties"]
}
Encountering a syntax error when trying to run the code on Internet Explorer:
DF.fn = () => {
// Code content
};