Skip to content

Commit a4c01ed

Browse files
committed
Document new artifactFilename option
1 parent 075d9cc commit a4c01ed

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,36 @@ module.exports = {
163163

164164
Directory where the zipped browser extension should get created.
165165

166+
- **artifactFilename**
167+
168+
- Type: `Function`
169+
- Default: ``({name, version, mode}) => `${name}-v${version}-${mode}.zip` ``
170+
171+
Optional function to generate a custom artifact filename. Useful for naming builds for different browsers.
172+
173+
The function takes a single object parameter containing:
174+
- `name` - Name from `package.json`
175+
- `version` - Version from `package.json`
176+
- `mode` - Vue CLI mode such as 'production'
177+
178+
For example,
179+
180+
```js
181+
// vue.config.js
182+
module.exports = {
183+
pluginOptions: {
184+
browserExtension: {
185+
artifactFilename: ({ name, version, mode }) => {
186+
if (mode === 'production') {
187+
return `${name}-v${version}-${process.env.BROWSER}.zip`;
188+
}
189+
return `${name}-v${version}-${process.env.BROWSER}-${mode}.zip`;
190+
},
191+
},
192+
},
193+
};
194+
```
195+
166196
### Component options
167197

168198
Some browser extension components have additional options which can be set as follows:

0 commit comments

Comments
 (0)