forked from nautls/nautilus-wallet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvue.config.js
executable file
·69 lines (60 loc) · 1.79 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const WindiCSSWebpackPlugin = require("windicss-webpack-plugin");
const webpack = require("webpack");
const commitHash = require("child_process").execSync("git rev-parse HEAD").toString().trim();
module.exports = {
publicPath: "/",
productionSourceMap: false,
devServer: {
writeToDisk: true
},
lintOnSave: false,
configureWebpack: {
devtool: "none",
optimization: {
splitChunks: {
chunks: "all"
}
}
},
pages: {
index: { entry: "src/main.ts", template: "public/index.html", title: "Nautilus" },
background: { entry: "src/background/background.ts", template: "public/background.html" }
},
chainWebpack: (config) => {
config.output.filename("js/[name].js").chunkFilename("js/[name].js").end();
config.plugin("copy").tap(([pathConfigs]) => {
pathConfigs.push({
from: "src/content-scripts",
to: "js"
});
return [pathConfigs];
});
config.plugin("define").tap((options) => {
options[0]["process.env"].GIT_HASH = JSON.stringify(commitHash);
options[0]["process.env"].MAINNET = JSON.stringify(!process.argv.includes("--testnet"));
return options;
});
config
.plugin("ignore")
.use(new webpack.IgnorePlugin(/^\.\/wordlists\/(?!english)/, /bip39\\src$/));
config
.plugin("clean-output")
.use(
new CleanWebpackPlugin({
cleanStaleWebpackAssets: false
})
)
.end();
const svgRule = config.module.rule("svg");
svgRule.uses.clear();
svgRule
.use("vue-loader")
.loader("vue-loader-v16")
.end()
.use("vue-svg-loader")
.loader("vue-svg-loader")
.end();
config.plugin("windicss").use(new WindiCSSWebpackPlugin()).end();
}
};