Explicitly specify browser compatibility in babel

We do this in cockpit and cockpit-ostree.
This commit is contained in:
Martin Pitt 2019-07-11 13:19:53 +02:00 committed by Katerina Koukiou
parent 077eba3ede
commit eea86c986f
2 changed files with 21 additions and 7 deletions

View file

@ -1,4 +0,0 @@
{
"presets": ["@babel/env",
"@babel/preset-react"]
}

View file

@ -95,6 +95,24 @@ if (production) {
})); }));
} }
var babel_loader = {
loader: "babel-loader",
options: {
presets: [
["@babel/env", {
"targets": {
"chrome": "57",
"firefox": "52",
"safari": "10.3",
"edge": "16",
"opera": "44"
}
}],
"@babel/preset-react"
]
}
}
module.exports = { module.exports = {
mode: production ? 'production' : 'development', mode: production ? 'production' : 'development',
entry: info.entries, entry: info.entries,
@ -117,17 +135,17 @@ module.exports = {
}, },
{ {
exclude: /node_modules/, exclude: /node_modules/,
loader: 'babel-loader', use: babel_loader,
test: /\.js$/ test: /\.js$/
}, },
{ {
exclude: /node_modules/, exclude: /node_modules/,
loader: 'babel-loader', use: babel_loader,
test: /\.jsx$/ test: /\.jsx$/
}, },
{ {
exclude: /node_modules/, exclude: /node_modules/,
loader: 'babel-loader', use: babel_loader,
test: /\.es6$/ test: /\.es6$/
}, },
{ {