-
Notifications
You must be signed in to change notification settings - Fork 16
/
vue.config.js
63 lines (60 loc) · 1.27 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
'use strict'
const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
lintOnSave: false,
productionSourceMap: false,
outputDir: "html",
publicPath: "/",
devServer: {
open: true,
port: 8102
},
chainWebpack: (config) => {
config.module
.rule("scss")
.oneOf("vue")
.use("px2rem")
.loader("px2rem-loader")
.before("postcss-loader")
.options({
remUnit: 75,
remPrecision: 8,
})
.end()
.rule("js")
.include.add("/packages")
.end()
.use("babel")
.loader("babel-loader")
.tap((options) => {
return options;
});
},
configureWebpack: {
// provide the app's title in webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
resolve: {
alias: {
'@': resolve('src'),
'images': resolve('src/assets/images'),
}
}
},
css: {
extract: true,
sourceMap: false,
requireModuleExtension: true,
loaderOptions: {
// css: {
// // 这里的选项会传递给 css-loader
// importLoaders: 1,
// },
sass: {
additionalData: `@import "@/assets/styles/variables.scss";`,
},
},
},
};