-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
35 lines (35 loc) · 967 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
// app参数可以理解为一个封装好的ajax url 请求地址,data模拟的数据
/*
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 = {
publicPath: process.env.NODE_ENV === 'production'
? './'
: '/',
devServer: {
/*
// 在服务内部的所有其他中间件之前,提供执行自定义中间件的功能。
before(app) {
mock(app, '/book/home', homeData)
mock(app, '/book/shelf', shelfData)
mock(app, '/book/list', listData)
mock(app, '/book/flat-list', flatListData)
}
*/
},
configureWebpack: {
performance: {
hints: 'warning',
maxAssetSize: 524288 * 10,
maxEntrypointSize: 524288 * 10
}
}
}