vue.config.js
991 Bytes
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
const path = require('path');
function resolve(dir) {
return path.join(__dirname, dir);
}
module.exports = {
// 修改 src 为 examples
pages: {
index: {
entry: 'examples/main.js',
template: 'public/index.html',
filename: 'index.html'
}
},
// eslint-loader 是否在保存的时候检查
lintOnSave: true,
// webpack配置
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('examples'))
config.module
.rule("md")
.test(/\.md/)
.use("vue-loader")
.loader("vue-loader")
.options({
compilerOptions: {
preserveWhitespace: false
}
})
.end()
.use("markdown-loader")
.loader(
path.resolve(__dirname, "./webpack/markdown-loader.js")
)
.end();
},
// webpack-dev-server 相关配置
devServer: {
open: false,
host: '0.0.0.0',
port: 8888,
https: false,
hotOnly: false,
disableHostCheck: true,
},
}