forked from ymm-tech/gods-pen-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
94 lines (90 loc) · 2.26 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
const path = require('path')
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')
const config = require('./src/config/index')
const configureWebpack = {
resolve: {
alias: {
'src': path.join(__dirname, 'src')
}
},
externals: {
'jQuery': 'jQuery',
'plupload': 'plupload',
},
module: {
rules: [{
test: /\.md$/,
use: [
{ loader: 'html-loader' },
{ loader: 'markdown-loader' }
]
}]
},
plugins: [new MonacoWebpackPlugin()]
}
if (process.env.NODE_ENV === 'production') {
configureWebpack.externals.vue = 'Vue'
configureWebpack.externals['vue-router'] = 'VueRouter'
configureWebpack.externals.vuex = 'Vuex'
}
module.exports = {
publicPath: '/' + config.ADMIN_NAME,
assetsDir: 'static',
outputDir: `dist/${config.ADMIN_NAME || 'admin'}`,
lintOnSave: process.env.NODE_ENV !== 'production',
productionSourceMap: process.env.NODE_ENV !== 'production',
pages: {
index: {
entry: './src/main.js',
filename: 'index.html',
template: './index.tpl',
title: config.ADMIN_TITLE,
hmid: config.BAIDU_TONGJI
},
login: {
entry: './src/login.js',
filename: 'login.html',
template: './login.tpl',
title: config.ADMIN_TITLE,
hmid: config.BAIDU_TONGJI
},
emailActive: {
entry: './src/emailActive.js',
filename: 'emailActive.html',
template: './emailActive.tpl',
title: config.ADMIN_TITLE,
hmid: config.BAIDU_TONGJI
},
updatePassword: {
entry: './src/updatePassword.js',
filename: 'updatePassword.html',
template: './updatePassword.tpl',
title: config.ADMIN_TITLE,
hmid: config.BAIDU_TONGJI
}
},
devServer: {
disableHostCheck: true,
port: 8567,
publicPath: '/',
},
configureWebpack: configureWebpack,
chainWebpack: config => {
config.plugins.delete('preload-index')
config.plugins.delete('prefetch-index')
config.plugin('define').tap(args => {
args[0]['process.env'].CODE_ENV = JSON.stringify(process.env.CODE_ENV)
return args
})
config.module
.rule('wasm')
.test(/\.wasm$/)
.use('file-loader')
.loader('file-loader')
.tap(options => {
return {
limit: 0
}
})
}
}