-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.dev.js
35 lines (34 loc) · 1.2 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
32
33
34
35
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: "inline-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(content.toString())
})
);
}
},
{
from: "src/assets",
to: "assets/"
}
]
})
]
});
};