-
Notifications
You must be signed in to change notification settings - Fork 0
/
fdk.config.js
49 lines (42 loc) · 1.19 KB
/
fdk.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
44
45
46
47
48
49
const path = require('path');
function addStyleResource(rule) {
rule.use('style-resource')
.loader('style-resources-loader')
.options({
patterns: [
path.resolve(__dirname, './theme/global/variables.less')
],
injector: 'prepend'
})
}
module.exports = {
chainWebpack: config => {
//vue-svg-loader
const svgRule = config.module.rule('svg');
svgRule.uses.clear();
svgRule
.use('babel-loader')
.loader('babel-loader')
.end()
.use('vue-svg-loader')
.loader('vue-svg-loader');
// disable eslint
config.module.rules.delete('eslint');
const imagesRule = config.module.rule('images');
imagesRule.uses.clear();
imagesRule
.test(/\.(jpe?g|png|gif|webp)$/)
.use('file-loader')
.loader('file-loader')
.tap(options => {
return {
name: '[name].[contenthash].[ext]',
publicPath: process.env.IMAGE_CDN_URL,
outputPath: 'assets/images'
};
});
// append variables.less before every style
const types = ['vue-modules', 'vue', 'normal-modules', 'normal']
types.forEach(type => addStyleResource(config.module.rule('less').oneOf(type)))
}
}