From 1374b5f26ff1e5931bd9d1e4ffc2ec293e2b37f4 Mon Sep 17 00:00:00 2001 From: Kate Hudson Date: Fri, 12 Jan 2018 16:56:29 -0500 Subject: [PATCH] feat(webpack): Add --display-optimization-bailout and use jsm-to-esmodules (#3932) Fix Bug 1426520 - Run webpack with --display-optimization-bailout --- package-lock.json | 8 ++++---- package.json | 4 ++-- webpack.system-addon.config.js | 2 +- yamscripts.yml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 38f5f7926a..ee0f3121fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -488,10 +488,10 @@ "babel-runtime": "6.26.0" } }, - "babel-plugin-jsm-to-commonjs": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jsm-to-commonjs/-/babel-plugin-jsm-to-commonjs-0.2.0.tgz", - "integrity": "sha1-yrniaqJReHQZ6WhRqA5PY1MjpSs=", + "babel-plugin-jsm-to-esmodules": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/babel-plugin-jsm-to-esmodules/-/babel-plugin-jsm-to-esmodules-0.2.2.tgz", + "integrity": "sha1-8bIXXHlOdQjREOUtR03vG2APbxA=", "dev": true }, "babel-plugin-syntax-async-functions": { diff --git a/package.json b/package.json index a5ed634784..3a0563f39e 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "devDependencies": { "babel-core": "6.26.0", "babel-loader": "7.1.2", - "babel-plugin-jsm-to-commonjs": "0.2.0", + "babel-plugin-jsm-to-esmodules": "0.2.2", "babel-plugin-transform-async-to-module-method": "6.24.1", "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", "babel-preset-react": "6.24.1", @@ -88,7 +88,7 @@ "buildmc": "npm-run-all buildmc:*", "prebuildmc": "npm run cleanmc", "buildmc:locales": "pontoon-to-json --src locales --dest system-addon/data", - "buildmc:webpack": "webpack --config webpack.system-addon.config.js", + "buildmc:webpack": "webpack --config webpack.system-addon.config.js --display-optimization-bailout", "buildmc:css": "node-sass system-addon/content-src/styles -o system-addon/css", "buildmc:html": "rimraf system-addon/prerendered && webpack --config webpack.prerender.config.js && node ./bin/render-activity-stream-html.js", "buildmc:copy": "cpx \"system-addon/**/{,.}*\" $npm_package_config_mc_dir/browser/extensions/activity-stream", diff --git a/webpack.system-addon.config.js b/webpack.system-addon.config.js index 2f9d2574fc..95260b7d31 100644 --- a/webpack.system-addon.config.js +++ b/webpack.system-addon.config.js @@ -25,7 +25,7 @@ module.exports = { exclude: /node_modules/, loader: "babel-loader", // Converts .jsm files into common-js modules - options: {plugins: [["jsm-to-commonjs", {basePath: resourcePathRegEx, replace: true}]]} + options: {plugins: [["jsm-to-esmodules", {basePath: resourcePathRegEx, replace: true}]]} } ] }, diff --git a/yamscripts.yml b/yamscripts.yml index 5efffb77ba..6ab49bcdf3 100644 --- a/yamscripts.yml +++ b/yamscripts.yml @@ -18,7 +18,7 @@ scripts: buildmc: pre: =>cleanmc locales: pontoon-to-json --src locales --dest system-addon/data - webpack: webpack --config webpack.system-addon.config.js + webpack: webpack --config webpack.system-addon.config.js --display-optimization-bailout css: node-sass system-addon/content-src/styles -o system-addon/css html: rimraf system-addon/prerendered && webpack --config webpack.prerender.config.js && node ./bin/render-activity-stream-html.js # Copy over all of the system-addon directory