@infomaximum/json-modify-webpack-plugin
v1.1.0
Published
```sh yarn add @infomaximum/json-modify-webpack-plugin ```
Downloads
26
Readme
Installation
yarn add @infomaximum/json-modify-webpack-plugin
Usage
const { JsonModifyWebpackPlugin } = require("./plugin");
const PackageJSON = require("./package.json");
const webpackConfig = {
entry: [
"./src/index.js",
"./manifest.json"
],
output: {
path: path.resolve("build"),
filename: packageFilename,
clean: true,
},
plugins: [
new JsonModifyWebpackPlugin({
matchers: [
{
matcher: /^manifest.json$/,
action: (currentJsonContent) => {
currentJsonContent.version = PackageJSON.version;
return currentJsonContent;
},
},
],
}),
];
}