-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
53 lines (51 loc) · 1.12 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
const path = require('path');
function resolve(dir) {
return path.join(__dirname, './', dir);
}
module.exports = {
pages: {
index: {
// page 的入口
entry: './example/main.js',
// 模板来源
template: './example/index.html',
// 在 dist/index.html 的输出
filename: 'index.html',
// 当使用 title 选项时,
// template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
title: 'Example Page'
}
},
assetsDir: 'assets',
publicPath: './',
lintOnSave: false,
// 配置别名
chainWebpack: (config) => {
return config;
},
configureWebpack: (config) => {
// 子模块路径别名
config.resolve.alias = {
'@': path.resolve('src'),
};
},
css: {
loaderOptions: {
sass: {
sourceMap: false
},
less: {
sourceMap: false,
lessOptions: {
javascriptEnabled: true
}
}
}
},
pluginOptions: {
'style-resources-loader': {
preProcessor: 'scss',
patterns: [resolve('src/index.scss'), resolve('src/comps.scss')]
}
}
};