-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
41 lines (38 loc) · 997 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
36
37
38
39
40
41
// const { defineConfig } = require('@vue/cli-service')
// module.exports = defineConfig({
// transpileDependencies: true
// })
function mock(app, url, data) {
app.get(url, (request, response) => {
response.json(data)
})
}
const homeData = require('./src/mock/bookHome')
const shelfData = require('./src/mock/bookShelf')
const listData = require('./src/mock/bookList')
const flatListData = require('./src/mock/bookFlatList')
module.exports = {
baseUrl: process.env.NODE_ENV === 'production' ? './' : '/',
devServer: {
port: 5432,
before(app) {
mock(app, '/book/home', homeData)
mock(app, '/book/shelf', shelfData)
mock(app, '/book/list', listData)
mock(app, '/book/flat-list', flatListData)
},
proxy: {
'/': {
target: 'http://47.99.166.157.com',
changeOrigin: true,
ws: false
}
},
allowedHosts: [
'.shulaoya.fun'
]
},
//关闭eslint 校验
// eslint: false,
lintOnSave: false
}