-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
44 lines (39 loc) · 963 Bytes
/
vue.config.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
36
37
38
39
40
41
42
43
44
const CopyWebpackPlugin = require("copy-webpack-plugin");
const path = require("path");
// Generate pages object
const pagesObj = {};
const chromeName = ["popup", "options", "content"];
chromeName.forEach(name => {
pagesObj[name] = {
entry: `src/${name}/index.js`,
template: "public/index.html",
filename: `${name}.html`,
};
});
const plugins =
process.env.NODE_ENV === "production"
? [
{
from: path.resolve("src/manifest.production.json"),
to: `${path.resolve("dist")}/manifest.json`,
},
]
: [
{
from: path.resolve("src/manifest.development.json"),
to: `${path.resolve("dist")}/manifest.json`,
},
];
module.exports = {
pages: pagesObj,
configureWebpack: {
plugins: [CopyWebpackPlugin(plugins)],
resolve: {
alias: {
components: "@/components",
assets: "@/assets",
utils: "@/utils",
},
},
},
};