-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
43 lines (37 loc) · 929 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
42
43
const path = require('path');
const glob = require('glob');
process.env.VUE_APP_VERSION = require('./package.json').version;
process.env.VUE_APP_MODULES = glob.sync(path.join('src', '_*', 'index.js')).map(filePath => {
const location = path.dirname(filePath);
const dirName = location.split(path.sep).pop();
return dirName;
}).join(',');
process.env.VUE_APP_DATA_FIELS = glob.sync(path.join('src', 'data', '**', '*.*')).map(filePath => {
return filePath.substring(4); // rm src/
}).join('|_|');
module.exports = {
devServer: {
proxy: {
'/api': {
target: 'http://localhost:3000/',
changeOrigin: true
}
}
},
css: {
loaderOptions: {
sass: {
data: `@import "~@/scss/resources.scss";`
}
}
},
chainWebpack: (config) => {
// Custom CSV loader
const csvRule = config.module.rule('csv');
csvRule
.test(/\.(csv|tsv)$/)
.use('csv-loader')
.loader('csv-loader')
.end();
}
};