@@ -108,6 +108,32 @@ module.exports = {
108108 }
109109 ] ,
110110 loaders : [
111+ // Default loader: load all assets that are not handled
112+ // by other loaders with the url loader.
113+ // Note: This list needs to be updated with every change of extensions
114+ // the other loaders match.
115+ // E.g., when adding a loader for a new supported file extension,
116+ // we need to add the supported extension to this loader too.
117+ // Add one new line in `exclude` for each loader.
118+ //
119+ // "file" loader makes sure those assets get served by WebpackDevServer.
120+ // When you `import` an asset, you get its (virtual) filename.
121+ // In production, they would get copied to the `build` folder.
122+ // "url" loader works like "file" loader except that it embeds assets
123+ // smaller than specified limit in bytes as data URLs to avoid requests.
124+ // A missing `test` is equivalent to a match.
125+ {
126+ exclude : [
127+ / \. ( j s | j s x ) $ / ,
128+ / \. c s s $ / ,
129+ / \. j s o n $ /
130+ ] ,
131+ loader : 'url' ,
132+ query : {
133+ limit : 10000 ,
134+ name : 'static/media/[name].[hash:8].[ext]'
135+ }
136+ } ,
111137 // Process JS with Babel.
112138 {
113139 test : / \. ( j s | j s x ) $ / ,
@@ -138,26 +164,6 @@ module.exports = {
138164 {
139165 test : / \. j s o n $ / ,
140166 loader : 'json'
141- } ,
142- // "file" loader makes sure those assets get served by WebpackDevServer.
143- // When you `import` an asset, you get its (virtual) filename.
144- // In production, they would get copied to the `build` folder.
145- {
146- test : / \. ( i c o | j p g | j p e g | p n g | g i f | e o t | o t f | w e b p | s v g | t t f | w o f f | w o f f 2 ) ( \? .* ) ? $ / ,
147- loader : 'file' ,
148- query : {
149- name : 'static/media/[name].[hash:8].[ext]'
150- }
151- } ,
152- // "url" loader works just like "file" loader but it also embeds
153- // assets smaller than specified size as data URLs to avoid requests.
154- {
155- test : / \. ( m p 4 | w e b m | w a v | m p 3 | m 4 a | a a c | o g a ) ( \? .* ) ? $ / ,
156- loader : 'url' ,
157- query : {
158- limit : 10000 ,
159- name : 'static/media/[name].[hash:8].[ext]'
160- }
161167 }
162168 ]
163169 } ,
0 commit comments