forked from wwELi/ccms-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack-common-loaders.js
52 lines (50 loc) · 1.09 KB
/
webpack-common-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
41
42
43
44
45
46
47
48
49
50
51
52
/**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2016-07-14
*/
module.exports = [
{
test: /\.js$/,
loaders: ['babel'],
exclude: /(node_modules|bower_components|assets)/
},
{
test: /\.json$/,
loaders: ['json'],
exclude: /(node_modules|bower_components)/
},
{
// for fucking jquery plugin
test: /node_modules(\/\\)jquery\.nicescroll\1jquery\.nicescroll\.js/,
loader: 'imports?define=>false'
},
{
test: /\.tpl\.html$/,
loader: 'html',
query: {interpolate: true},
exclude: /(node_modules|bower_components)/
},
{
test: /\.(jpe?g|png|gif)$/i,
loaders: [
'file?hash=sha512&digest=hex&name=[hash:8].[ext]'
]
},
{
test: /\.(woff|woff2)(\?t=\d+)?$/,
loader: 'url?limit=10000&mimetype=application/font-woff&prefix=fonts'
},
{
test: /\.ttf(\?t=\d+)?$/,
loader: 'url?limit=10000&mimetype=application/octet-stream&prefix=fonts'
},
{
test: /\.eot(\?t=\d+)?$/,
loader: 'url?limit=10000&mimetype=application/vnd.ms-fontobject&prefix=fonts'
},
{
test: /\.svg(\?t=\d+)?$/,
loader: 'url?limit=10000&mimetype=image/svg+xml&prefix=fonts'
}
];