This repository has been archived by the owner on Sep 20, 2019. It is now read-only.
forked from hashgraph/MyHbarWallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
72 lines (68 loc) · 2.32 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
70
71
72
/* eslint-env node */
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require("path");
const package = require("./package.json");
const webpack = require("webpack");
const hash = require("child_process").execSync("git rev-parse --short HEAD");
module.exports = {
css: {
// Turn on CSS source maps in development
sourceMap: process.env.NODE_ENV !== "production"
},
configureWebpack: {
target: "web",
plugins: [
new webpack.DefinePlugin({
VERSION: `"${package.version.toString()}"`,
COMMIT_HASH: `"${hash.toString().trim()}"`,
HEDERA_NETWORK: `"${process.env.HEDERA_NETWORK || "testnet"}"`
})
]
// ,
// entry: {
// home: "./src/app.vue",
// access: "./src/views/AccessMyAccount.vue"
// }
},
chainWebpack(config) {
// Use a standard HTML template instead of rolling our own (which is default)
// https://github.com/jaketrent/html-webpack-template#basic-usage
config.plugin("html").tap(args => [
{
...args[0],
template: path.resolve(__dirname, "src/index.html")
}
]);
config.plugin("fork-ts-checker").tap(args => [
{
...args[0],
// Only report errors
silent: true,
// Use as much threads as we have physical CPUs
workers: require("os").cpus().length
}
]);
if (process.env.NODE_ENV === "production") {
// Use the advanced preset for cssnano instead of the default.
// https://cssnano.co/guides/optimisations
config.plugin("optimize-css").tap(args => [
{
...args[0],
preset: [
"advanced",
{
discardComments: { removeAll: true }
}
]
}
]);
// Pass images through an optimization pipeline
config.module
.rule("optimize-images")
.test(/\.(jpg|png|gif|svg)$/)
.pre()
.use()
.loader("image-webpack-loader");
}
}
};