webpack-extension-manifest-plugin
Version:
Creates manifest json file based you config
69 lines (52 loc) • 2.87 kB
Markdown
# webpack-extension-manifest-plugin
> Creates manifest json file based on you config
[](https://travis-ci.org/Scrum/webpack-extension-manifest-plugin)[](https://ci.appveyor.com/project/GitScrum/webpack-extension-manifest-plugin)[]()[](https://www.npmjs.com/package/webpack-extension-manifest-plugin)[](https://david-dm.org/Scrum/webpack-extension-manifest-plugin)[](https://github.com/sindresorhus/xo)[](https://coveralls.io/r/Scrum/webpack-extension-manifest-plugin)
[](https://www.npmjs.com/package/webpack-extension-manifest-plugin)[](https://www.npmjs.com/package/webpack-extension-manifest-plugin)
## Why ?
Simplifies the development of cross-platform browser extension
- [x] Firefox
- [x] Chrome
- [x] EDGE
- [ ] Safari
## Install
```bash
npm i -D webpack-extension-manifest-plugin
```
> **Note:** This project is compatible with node v10+
## Usage
**baseManifest.js**
```js
export default {
name: 'my manifest'
};
```
**webpack.config.js**
```js
import WebpackExtensionManifestPlugin from 'webpack-extension-manifest-plugin';
module.exports = {
plugins: [
new WebpackExtensionManifestPlugin({
config: {
base: './baseManifest.js',
extend: {description: 'my description'}
},
pkgJsonProps: [
'version'
]
})
]
};
```
*Create manifest.json with extend configs `{name: 'my manifest', description: 'my description', version: '0.0.0'}`*
## Options
### `config`
Type: `Object`
Default: `{}`
Description: *Can take a ready-made configuration or filename (to fetch from) for the manifest file, or a set of parameters `base`, `extend` (both of which can be a filename or an object)*
### `minify`
Type: `Boolean`
Default: `false`
Description: *Controls if the output should be minified*
### `pkgJsonProps`
Type: `Array of strings`
Description: *Adds specified properties from your package.json file into the manifest*