mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
fix: use acorn and drop babel-loader by default (#9320)
This commit is contained in:

committed by
GitHub

parent
e82a364dd4
commit
482b7b11f6
@ -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')
|
||||
|
@ -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';
|
||||
|
Reference in New Issue
Block a user