From feea7fe281a8fa536937e7c26d0325f43abf79c9 Mon Sep 17 00:00:00 2001 From: Dan Bucholtz Date: Mon, 10 Jul 2017 13:15:16 -0500 Subject: [PATCH] fix(serve): fix cached file issue by only using the webpack module concat plugin for prod builds, make sure you update custom configs --- config/webpack.config.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/webpack.config.js b/config/webpack.config.js index 56dc2b63..60d8a959 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -4,6 +4,11 @@ var ionicWebpackFactory = require(process.env.IONIC_WEBPACK_FACTORY); var ModuleConcatPlugin = require('webpack/lib/optimize/ModuleConcatenationPlugin'); +var prodPlugins = []; +if (process.env.IONIC_ENV === 'prod') { + prodPlugins.push(new ModuleConcatPlugin()); +} + module.exports = { entry: process.env.IONIC_APP_ENTRY_POINT, output: { @@ -39,8 +44,7 @@ module.exports = { plugins: [ ionicWebpackFactory.getIonicEnvironmentPlugin(), ionicWebpackFactory.getCommonChunksPlugin(), - new ModuleConcatPlugin(), - ], + ].concat(prodPlugins), // Some libraries import Node modules but don't use them in the browser. // Tell Webpack to provide empty mocks for them so importing them works.