-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
57 lines (56 loc) · 1.4 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
const version = require("./package.json").version;
const webpack = require("webpack");
module.exports = {
pluginOptions: {
i18n: {
locale: "en",
fallbackLocale: "en",
localeDir: "locales",
enableInSFC: true,
},
},
css: {
loaderOptions: {
sass: {
additionalData: `@import "~@/sass/main.scss"`,
},
},
},
configureWebpack: (config) => {
config.cache = process.env.SKIP_CACHE !== "true";
config.plugins.push(
new webpack.DefinePlugin({
"process.env": {
// When building, this value will just be printed without quotes, so we add them explicitly
APPLICATION_VERSION: `"Accentor Web v${version}"`,
},
}),
);
},
chainWebpack: (config) => {
config.module
.rule("js")
.use("babel-loader")
.tap((opt) =>
Object.assign(opt, {
cacheDirectory: process.env.SKIP_CACHE !== "true",
}),
);
config
.plugin("eslint")
.tap((args) => [
Object.assign(args[0], { cache: process.env.SKIP_CACHE !== "true" }),
]);
["vue-modules", "vue", "normal-modules", "normal"].forEach((match) => {
config.module
.rule("scss")
.oneOf(match)
.use("sass-loader")
.tap((opt) =>
Object.assign(opt, {
additionalData: `@import '~@/sass/main.scss';`,
}),
);
});
},
};