I have problem with Safari version <= 9. Babel doesn't seem to replace const with var.
I get this error in console:
Unexpected keyword 'const'. Const declarations are not supported in strict mode.
I tried using @babel/preset-stage-0 but babel removed it.
This is my app configuration:
.babelrc
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-transform-object-assign"
]
}
webpack.config.js
const path = require("path");
const webpack = require("webpack");
const componentName = "contact-captain";
const publicFolderRelativePath = "../../../../public/js";
const ignorePlugin = new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/);
module.exports = {
// devtool: "source-map",
output: {
path: path.resolve(__dirname, publicFolderRelativePath),
filename: `${componentName}.js`
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
}
]
},
plugins: [
ignorePlugin
]
};