forked from kuan1/kuan-vue-waterfall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
62 lines (53 loc) · 1.31 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
const path = require('path')
const isDev = process.env.NODE_ENV === 'development'
const resolve = (dir) => path.resolve(__dirname, dir)
const testEntry = path.resolve(__dirname, 'test/index.js')
const srcEntry = path.resolve(__dirname, 'src/index.js')
const demoConfig = {
publicPath: isDev ? '/' : `/kuan-vue-waterfall/demo/`, // public path
outputDir: resolve('demo'), // 输入地址
devServer: {
proxy: 'https://www.luzhongkuan.cn',
disableHostCheck: true,
},
configureWebpack: {
entry: {
app: testEntry,
},
},
chainWebpack(config) {
config.resolve.alias.set('kuan-vue-waterfall', path.resolve(__dirname, 'src'))
}
}
const libConfig = {
outputDir: resolve('lib'), // 输入地址
css: {
extract: false,
},
configureWebpack: {
externals: {
vue: { commonjs: 'vue', commonjs2: 'vue', root: 'Vue' },
},
entry: {
app: srcEntry,
},
},
productionSourceMap: false,
}
const testConfig = {
publicPath: '/', // public path
configureWebpack: {
entry: {
app: testEntry,
},
},
chainWebpack(config) {
config.resolve.alias.set('kuan-vue-waterfall', path.resolve(__dirname, 'src'))
}
}
const configMap = {
test: testConfig,
demo: demoConfig
}
const config = configMap[process.env.BUILD_TARGET] || libConfig
module.exports = config