-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathwebpack.dev.js
31 lines (30 loc) · 1.06 KB
/
webpack.dev.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const pkg = require("./package.json");
const common = require("./webpack.common.js");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const {merge} = require("webpack-merge");
module.exports = (env) => {
return merge(common, {
mode: "development",
devtool: "source-map",
plugins: [
new CopyWebpackPlugin({
patterns: [
{
from: `src/${env.manifest}`,
to: "manifest.json",
transform: (content) => {
return Buffer.from(
JSON.stringify({
description: pkg.description,
version: `${pkg.version}`,
version_name: `${pkg.version}-dev`,
...JSON.parse(String(content))
})
);
}
}
]
})
]
});
};