@@ -32,7 +32,8 @@ module.exports = {
3232 loaders : [
3333 //a regexp that tells webpack use the following loaders on all
3434 //.js and .jsx files
35- { test : / \. j s x ? $ / ,
35+ {
36+ test : / \. j s x ? $ / ,
3637 //we definitely don't want babel to transpile all the files in
3738 //node_modules. That would take a long time.
3839 exclude : / n o d e _ m o d u l e s / ,
@@ -42,7 +43,42 @@ module.exports = {
4243 //specify that we will be dealing with React code
4344 presets : [ 'react' ]
4445 }
45- }
46+ } ,
47+ // the next regex tells webpack to use style-loader and css-loader
48+ // (notice the chaining through the '!' syntax)
49+ // on all css files
50+ {
51+ test : / \. c s s $ / ,
52+ use : 'style-loader!css-loader'
53+ } ,
54+ {
55+ test : / \. p n g $ / ,
56+ use : 'url-loader?limit=100000'
57+ } ,
58+ {
59+ test : / \. j p g $ / ,
60+ use : 'file-loader'
61+ } ,
62+ {
63+ test : / \. p n g $ / ,
64+ use : 'url-loader?limit=100000'
65+ } ,
66+ {
67+ test : / \. ( w o f f | w o f f 2 ) ( \? v = \d + \. \d + \. \d + ) ? $ / ,
68+ loader : 'url?limit=10000&mimetype=application/font-woff'
69+ } ,
70+ {
71+ test : / \. t f f ( \? v = \d + \. \d + \. \d + ) ? $ / ,
72+ loader : 'url?limit=10000&mimetype=application/octet-stream'
73+ } ,
74+ {
75+ test : / \. e o t ( \? v = \d + \. \d + \. \d + ) ? $ / ,
76+ loader : 'file'
77+ } ,
78+ {
79+ test : / \. s v g ( \? v = \d + \. \d + \. \d + ) ? $ / ,
80+ loader : 'url?limit=10000&mimetype=image/svg+xml'
81+ } ,
4682 ]
4783 } ,
4884
@@ -52,4 +88,4 @@ module.exports = {
5288 //extensions that should be used to resolve modules
5389 extensions : [ '' , '.js' , '.jsx' ]
5490 }
55- }
91+ } ;
0 commit comments