Skip to content

Commit 731213c

Browse files
committed
Add environmentToZip option
1 parent 88e664e commit 731213c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const ZipPlugin = require('zip-webpack-plugin')
88
const defaultOptions = {
99
components: {},
1010
componentOptions: {},
11-
manifestSync: ['version']
11+
manifestSync: ['version'],
12+
environmentsToZip: ['production']
1213
}
1314

1415
module.exports = (api, options) => {
@@ -105,10 +106,10 @@ module.exports = (api, options) => {
105106
}
106107
}]))
107108

108-
if (isProduction) {
109+
if (pluginOptions.environmentsToZip.includes(api.service.mode)) {
109110
webpackConfig.plugins.push(new ZipPlugin({
110111
path: api.resolve(`${options.outputDir || 'dist'}-zip`),
111-
filename: `${packageJson.name}-v${packageJson.version}.zip`
112+
filename: `${packageJson.name}-v${packageJson.version}-${api.service.mode}.zip`
112113
}))
113114
}
114115

0 commit comments

Comments
 (0)