-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvue.config.js
33 lines (31 loc) · 947 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
const childProcess = require("child_process");
const gitVersion = childProcess
.execSync("git rev-parse HEAD")
.toString()
.trim();
const currentDate = new Date().toISOString();
const policy =
process.env.NODE_ENV === "production"
? `"default-src 'self'; img-src 'self' data:"`
: `"default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"`;
module.exports = {
publicPath:
process.env.NODE_ENV === "production" ? process.env.PUBLIC_PATH : "/",
outputDir: process.env.OUTPUT_DIR || "dist",
configureWebpack: {
plugins: [
new (require("webpack").DefinePlugin)({
"process.env.CURRENT_DATE": JSON.stringify(currentDate),
"process.env.GIT_VERSION": JSON.stringify(gitVersion),
Security_Policy: policy
})
]
},
css: {
loaderOptions: {
sass: {
prependData: `@import "@/assets/base.scss";`
}
}
}
};