Skip to content

Commit a677ace

Browse files
authored
Merge pull request adambullmer#72 from franciscolourenco/node-env
Replace modesToZip with `NODE_ENV=production`
2 parents e87f322 + 01676f4 commit a677ace

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,7 @@ module.exports = {
154154

155155
- **modesToZip**
156156

157-
- Type: `Array<string>`
158-
- Default: `['production']`
159-
160-
Array containing names of mode in which zipping up will trigger after build.
157+
Deprecated. Any mode will be zipped to the artifacts dir, when `NODE_ENV=production` (the default in the normal `yarn build`). For more information on how to set `NODE_ENV=production` in other modes see [Vue CLI docs – Example Staging Mode](https://cli.vuejs.org/guide/mode-and-env.html#example-staging-mode)
161158

162159
- **artifactsDir**
163160

index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const defaultOptions = {
1010
componentOptions: {},
1111
extensionReloaderOptions: {},
1212
manifestSync: ['version'],
13-
modesToZip: ['production'],
1413
manifestTransformer: null
1514
}
1615
const performanceAssetFilterList = [
@@ -27,7 +26,7 @@ module.exports = (api, options) => {
2726
const componentOptions = pluginOptions.componentOptions
2827
const extensionReloaderOptions = pluginOptions.extensionReloaderOptions
2928
const packageJson = require(api.resolve('package.json'))
30-
const isProduction = api.service.mode === 'production'
29+
const isProduction = process.env.NODE_ENV === 'production'
3130
const keyFile = api.resolve('key.pem')
3231
const hasKeyFile = keyExists(keyFile)
3332
const contentScriptEntries = Object.keys((componentOptions.contentScripts || {}).entries || {})
@@ -95,7 +94,7 @@ module.exports = (api, options) => {
9594
}
9695
}
9796

98-
if (pluginOptions.modesToZip.includes(api.service.mode)) {
97+
if (isProduction) {
9998
webpackConfig.plugin('zip-browser-extension').use(ZipPlugin, [
10099
{
101100
path: api.resolve(pluginOptions.artifactsDir || 'artifacts'),

0 commit comments

Comments
 (0)