-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathloaders.js
40 lines (39 loc) · 971 Bytes
/
loaders.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
const Dir = global.DIR;
export default function getLoaders() {
return {
eslint: {
test: /\.jsx?$/,
enforce: 'pre',
loader: 'eslint-loader',
exclude: /node_modules/,
include: Dir.src,
},
jsx: {
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /(node_modules)/,
},
json: {
test: /\.json$/,
loader: 'json-loader',
},
url: {
// the "?v=" regex fixes fontawesome issue
test: /\.((woff2?|svg)(\?v=[0-9]\.[0-9]\.[0-9]))|(woff2?|svg|jpe?g|png|gif|ico)$/,
loader: 'url-loader',
},
file: {
// the "?v=" regex fixes fontawesome issue
test: /\.((ttf|eot)(\?v=[0-9]\.[0-9]\.[0-9]))|(ttf|eot)$/,
loader: 'url-loader',
},
cssGlobal: {
test: /\.global\.css$/,
loader: 'style-loader!css-loader!postcss-loader',
},
cssModules: {
test: /^((?!\.global).)*\.css$/,
/* loader: based on target script */
},
};
}