From a78d3c102ac4eb882a6367ab7fcb7101fd17b13b Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 23 Aug 2018 00:42:28 -0230 Subject: [PATCH] fix(build): Apply bundle fix to legacy build The Webpack config for the modern build was adjusted recently to add a loader, which is used as a workaround for a bug introduced by a recent dependency update. The legacy config needed the same update. The Webpack config was also updated in superficial ways to follow recommendations made for migrating from Webpack v1 to v2 (e.g. using `module.rules` instead of `module.loaders`). These changes should have no functional impact, and should make migrating to future versions of Webpack easier. fix #6269 --- scripts/build-webpack.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/build-webpack.js b/scripts/build-webpack.js index 1b4d98ce63..6a39025cd9 100755 --- a/scripts/build-webpack.js +++ b/scripts/build-webpack.js @@ -28,11 +28,11 @@ const compiler = webpack({ 'packages/lockfile/index.js': path.join(basedir, 'src/lockfile/index.js'), }, module: { - loaders: [ + rules: [ { test: /\.js$/, exclude: /node_modules/, - loader: 'babel-loader', + use: 'babel-loader', }, { test: /rx\.lite\.aggregates\.js/, @@ -70,12 +70,20 @@ const compilerLegacy = webpack({ // devtool: 'inline-source-map', entry: path.join(basedir, 'src/cli/index.js'), module: { - loaders: [ + rules: [ { test: /\.js$/, exclude: /node_modules/, - loader: 'babel-loader', - query: babelRc.env['pre-node5'], + use: [ + { + loader:'babel-loader', + options: babelRc.env['pre-node5'], + } + ], + }, + { + test: /rx\.lite\.aggregates\.js/, + use: 'imports-loader?define=>false' }, ], },