-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathassets.js
More file actions
36 lines (35 loc) · 984 Bytes
/
Copy pathassets.js
File metadata and controls
36 lines (35 loc) · 984 Bytes
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
const plugin = require('webpack-isomorphic-tools/plugin');
module.exports = {
assets: {
images: {
extensions: ['gif', 'jpg', 'png', 'ico'],
parser: plugin.url_loader_parser
},
fonts: {
extensions: ['eot', 'ttf', 'woff', 'woff2'],
parser: plugin.url_loader_parser
},
svg: {
extension: 'svg',
parser: plugin.url_loader_parser
},
styles: {
extensions: ['css'],
filter(module, regex, options, log) {
return options.development
? plugin.style_loader_filter(module, regex, options, log)
: regex.test(module.name);
},
path(module, options, log) {
return options.development
? plugin.style_loader_path_extractor(module, options, log)
: module.name;
},
parser(module, options, log) {
return options.development
? plugin.css_modules_loader_parser(module, options, log)
: module.source;
}
}
}
};