Centralize Babel's own compilation config to make it easier to follow. (#7599)
This commit is contained in:
@@ -39,25 +39,18 @@ function webpackBuild(opts) {
|
||||
test: /\.js$/,
|
||||
loader: "babel-loader",
|
||||
options: {
|
||||
// Use the bundled config so that module syntax is passed through
|
||||
// for Webpack.
|
||||
envName: "standalone",
|
||||
|
||||
// Some of the node_modules may have their own "babel" section in
|
||||
// their project.json (or a ".babelrc" file). We need to ignore
|
||||
// those as we're using our own Babel options.
|
||||
babelrc: false,
|
||||
presets: [
|
||||
[
|
||||
"@babel/env",
|
||||
{
|
||||
loose: true,
|
||||
exclude: ["transform-typeof-symbol"],
|
||||
},
|
||||
],
|
||||
],
|
||||
overrides: [
|
||||
{
|
||||
exclude: /node_modules/,
|
||||
presets: [["@babel/stage-0", { loose: true }]],
|
||||
},
|
||||
],
|
||||
|
||||
// We explicitly load the `.babelrc.js` file since searching is
|
||||
// turned off, but we still want to use the main config.
|
||||
extends: "./.babelrc.js",
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user