fix: use acorn and drop babel-loader by default (#9320)

This commit is contained in:
Nathanael Anderson
2021-04-12 04:38:06 -05:00
committed by GitHub
parent e82a364dd4
commit 482b7b11f6
10 changed files with 10 additions and 185 deletions

View File

@ -208,19 +208,11 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
});
// set up js
// todo: do we need babel-loader? It's useful to support it
config.module
.rule('js')
.test(/\.js$/)
.exclude.add(/node_modules/)
.end()
.use('babel-loader')
.loader('babel-loader')
.options({
generatorOpts: {
compact: false,
},
});
.end();
config.module
.rule('workers')

View File

@ -1,3 +1,11 @@
// Make sure the Acorn Parser (used by Webpack) can parse ES-Stage3 code
// This must be at the top BEFORE webpack is loaded so that we can extend
// and replace the parser before webpack uses it
// Based on the issue: https://github.com/webpack/webpack/issues/10216
const stage3 = require('acorn-stage3');
const acorn = require('acorn');
acorn.Parser = acorn.Parser.extend(stage3);
import { highlight } from 'cli-highlight';
import { merge } from 'webpack-merge';
import Config from 'webpack-chain';