I'm trying to get my code working on Android 4.1 Webview, which doesn't support ES6.
But I am getting this error:
Uncaught SyntaxError: Use of const in strict mode.
.babelrc config
{
"plugins": [
"lodash"
],
"presets": [
"@babel/preset-react",
[
"@babel/preset-env",
{
"targets": {
"android": "4.1"
},
"useBuiltIns": "usage",
"forceAllTransforms": true
}
],
"@babel/preset-stage-0"
]
}
webpack.config.js
rules: [
{
enforce: 'pre',
test: /\.jsx?$/,
exclude: /node_modules/,
loader: "eslint-loader"
},
{
test: /\.jsx?$/,
loaders: 'babel-loader',
options: {
plugins: ['lodash']
},
exclude: /(node_modules|bower_components)/
},
]