-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack-loader.js
64 lines (57 loc) · 1000 Bytes
/
webpack-loader.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
53
54
55
56
57
58
59
60
61
62
63
64
/**
* Webpack Loaders
*
* 1. es6
* babel-loader
*
* 2. css
* css-loader
* style-loader
* postcss-loader
* stylus-loader
*/
import path from 'path'
const loaderBabel = {
test: /.jsx?$/,
loader: 'babel',
query: {
cacheDirectory: true
}
}
const loaderStyle = {
test: /\.styl$/,
exclude: [/node_modules/],
loader: 'style!css!stylus!'
}
/**
* Image Loader
*
* @see {@link https://github.com/thetalecrafter/img-loader}
*/
const loaderImage = {
test: /\.(jpe?g|png|gif|svg)$/,
loader: 'url?limit=10000!img?progressive=true'
}
/**
* Resolve File Path
*
* @see {@link https://webpack.github.io/docs/configuration.html#resolve}
*/
const roots = [
path.resolve('./Application'),
path.resolve('./Style'),
path.resolve('./Tool'),
path.resolve('./Image')
]
/**
* Exports.
*/
export const loaders = [
loaderBabel,
loaderStyle,
loaderImage
]
export const resolve = {
root: roots,
extensions: ['', '.js', '.jsx']
}