From 5c66ee8b008af40a465378d073a4f1ab0dde4fcd Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 23 Mar 2018 21:55:21 +0430 Subject: [PATCH 1/3] fix(loader): use options.minimize --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index feeb28005..1b0ceb6dc 100644 --- a/lib/index.js +++ b/lib/index.js @@ -30,7 +30,7 @@ module.exports = function (source) { const isServer = target === 'node' const isShadow = incomingQuery.shadow != null - const isProduction = minimize || process.env.NODE_ENV === 'production' + const isProduction = options.minimize || minimize || process.env.NODE_ENV === 'production' const filename = path.basename(resourcePath) const context = rootContext || process.cwd() const sourceRoot = path.dirname(path.relative(context, resourcePath)) From 88592e52760f36fec068ca2bdbfb0ee3e4373739 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 23 Mar 2018 22:08:12 +0430 Subject: [PATCH 2/3] misc(loader): rename options.minimize ~> options. productionMode --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 1b0ceb6dc..1fc558c41 100644 --- a/lib/index.js +++ b/lib/index.js @@ -30,7 +30,7 @@ module.exports = function (source) { const isServer = target === 'node' const isShadow = incomingQuery.shadow != null - const isProduction = options.minimize || minimize || process.env.NODE_ENV === 'production' + const isProduction = options.productionMode || minimize || process.env.NODE_ENV === 'production' const filename = path.basename(resourcePath) const context = rootContext || process.cwd() const sourceRoot = path.dirname(path.relative(context, resourcePath)) From 0677d19e3b0f39b594a8ca3c3a7321b66c7c3ada Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 23 Mar 2018 22:10:31 +0430 Subject: [PATCH 3/3] feat(doc): add productionMode to options list --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f401384df..7cad125a7 100644 --- a/README.md +++ b/README.md @@ -222,3 +222,4 @@ The following option has been changed to resourceQuery: - `transformAssetUrls` - `optimizeSSR` - `hotReload` +- `productionMode`