-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvue.config.js
31 lines (30 loc) · 1009 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
const swaggerResources = require('./tests/swagger-resources');
const swaggerJson = require('./tests/unit/utils/swagger.json');
const CompressionPlugin = require('compression-webpack-plugin');
module.exports = {
filenameHashing: false,
productionSourceMap: false,
publicPath: '',
indexPath: 'swagger-ui.html',
assetsDir: 'webjars/swagger-document-ui',
devServer: {
openPage: '/swagger-ui.html',
open: true,
proxy: 'http://swagger-bootstrap-ui.xiaominfo.com',
before: function(app) {
app.get('/swagger-resources.json', function(req, res) {
res.json(swaggerResources);
});
app.get('/swagger.json', function(req, res) {
res.json(swaggerJson);
});
}
},
configureWebpack: () => {
if (process.env.NODE_ENV === 'production') {
return {
plugins: [new CompressionPlugin({ exclude: /\/*.html/ })]
};
}
}
};