Move babel config into separate file
This works better with the current eslint loader, as then eslint and babel can look at the same configuration. See <https://babeljs.io/docs/en/config-files>. This is similar to .eslintrc.json.
This commit is contained in:
parent
04d6c566c7
commit
e449e94564
2 changed files with 15 additions and 20 deletions
14
.babelrc.json
Normal file
14
.babelrc.json
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"presets": [
|
||||||
|
["@babel/env", {
|
||||||
|
"targets": {
|
||||||
|
"chrome": "57",
|
||||||
|
"firefox": "52",
|
||||||
|
"safari": "10.3",
|
||||||
|
"edge": "16",
|
||||||
|
"opera": "44"
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
"@babel/preset-react"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -35,25 +35,6 @@ if (production) {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* keep this in sync with cockpit.git */
|
|
||||||
const babel_loader = {
|
|
||||||
loader: "babel-loader",
|
|
||||||
options: {
|
|
||||||
presets: [
|
|
||||||
["@babel/env", {
|
|
||||||
"targets": {
|
|
||||||
"chrome": "57",
|
|
||||||
"firefox": "52",
|
|
||||||
"safari": "10.3",
|
|
||||||
"edge": "16",
|
|
||||||
"opera": "44"
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
"@babel/preset-react"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* check if sassc is available, to avoid unintelligible error messages */
|
/* check if sassc is available, to avoid unintelligible error messages */
|
||||||
try {
|
try {
|
||||||
childProcess.execFileSync('sassc', ['--version'], { stdio: ['pipe', 'inherit', 'inherit'] });
|
childProcess.execFileSync('sassc', ['--version'], { stdio: ['pipe', 'inherit', 'inherit'] });
|
||||||
|
|
@ -100,7 +81,7 @@ module.exports = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
use: babel_loader,
|
use: "babel-loader",
|
||||||
test: /\.(js|jsx)$/
|
test: /\.(js|jsx)$/
|
||||||
},
|
},
|
||||||
/* HACK: remove unwanted fonts from PatternFly's css */
|
/* HACK: remove unwanted fonts from PatternFly's css */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue