-
Notifications
You must be signed in to change notification settings - Fork 229
/
vue.config.js
35 lines (33 loc) · 935 Bytes
/
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
const reduce = require('lodash/reduce')
const utils = require('./build/utils')
const config = require('./build/config')
module.exports = {
pages: {
app: {
title: 'VueLayers test app',
entry: utils.resolve('tests/main.js'),
template: utils.resolve('tests/index.html'),
filename: 'index.html',
},
},
chainWebpack: wc => {
/* eslint-disable indent */
wc.module
.rule('string-replace')
.test(/\.(js|vue|s?css)$/)
.use('string-replace-loader')
.loader('string-replace-loader')
.options({
multiple: reduce(config.replaces, (all, replace, search) => {
return all.concat({ replace, search, flags: 'g' })
}, []),
})
wc
.plugin('define')
.tap(args => {
args[0]['process.env'].VUELAYERS_DEBUG = process.env.NODE_ENV !== 'production'
return args
})
/* eslint-enable indent */
},
}