Commit 69bc1c1d authored by Pooya Parsa's avatar Pooya Parsa Committed by Evan You

feat(loader): support options.productionMode (#1208)

* fix(loader): use options.minimize

* misc(loader): rename options.minimize ~> options. productionMode

* feat(doc): add productionMode to options list
parent e9cbbcd8
...@@ -222,3 +222,4 @@ The following option has been changed to resourceQuery: ...@@ -222,3 +222,4 @@ The following option has been changed to resourceQuery:
- `transformAssetUrls` - `transformAssetUrls`
- `optimizeSSR` - `optimizeSSR`
- `hotReload` - `hotReload`
- `productionMode`
...@@ -30,7 +30,7 @@ module.exports = function (source) { ...@@ -30,7 +30,7 @@ module.exports = function (source) {
const isServer = target === 'node' const isServer = target === 'node'
const isShadow = incomingQuery.shadow != null const isShadow = incomingQuery.shadow != null
const isProduction = minimize || process.env.NODE_ENV === 'production' const isProduction = options.productionMode || minimize || process.env.NODE_ENV === 'production'
const filename = path.basename(resourcePath) const filename = path.basename(resourcePath)
const context = rootContext || process.cwd() const context = rootContext || process.cwd()
const sourceRoot = path.dirname(path.relative(context, resourcePath)) const sourceRoot = path.dirname(path.relative(context, resourcePath))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment