File tree 3 files changed +51
-1
lines changed
3 files changed +51
-1
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,32 @@ module.exports = {
213
213
name : 'static/media/[name].[hash:8].[ext]' ,
214
214
} ,
215
215
} ,
216
+ // Process WebWorkder JS with Babel.
217
+ // The preset includes JSX, Flow, and some ESnext features.
218
+ {
219
+ test : / \. w o r k e r \. ( j s | j s x | m j s ) $ / ,
220
+ include : paths . appSrc ,
221
+ use : [
222
+ require . resolve ( 'worker-loader' ) ,
223
+ // This loader parallelizes code compilation, it is optional but
224
+ // improves compile time on larger projects
225
+ require . resolve ( 'thread-loader' ) ,
226
+ {
227
+ loader : require . resolve ( 'babel-loader' ) ,
228
+ options : {
229
+ // @remove -on-eject-begin
230
+ babelrc : false ,
231
+ presets : [ require . resolve ( 'babel-preset-react-app' ) ] ,
232
+ // @remove -on-eject-end
233
+ // This is a feature of `babel-loader` for webpack (not Babel itself).
234
+ // It enables caching results in ./node_modules/.cache/babel-loader/
235
+ // directory for faster rebuilds.
236
+ cacheDirectory : true ,
237
+ highlightCode : true ,
238
+ } ,
239
+ } ,
240
+ ] ,
241
+ } ,
216
242
// Process application JS with Babel.
217
243
// The preset includes JSX, Flow, and some ESnext features.
218
244
{
Original file line number Diff line number Diff line change @@ -252,6 +252,29 @@ module.exports = {
252
252
name : 'static/media/[name].[hash:8].[ext]' ,
253
253
} ,
254
254
} ,
255
+ // Process WebWorkder JS with Babel.
256
+ // The preset includes JSX, Flow, and some ESnext features.
257
+ {
258
+ test : / \. w o r k e r \. ( j s | j s x | m j s ) $ / ,
259
+ include : paths . appSrc ,
260
+ use : [
261
+ require . resolve ( 'worker-loader' ) ,
262
+ // This loader parallelizes code compilation, it is optional but
263
+ // improves compile time on larger projects
264
+ require . resolve ( 'thread-loader' ) ,
265
+ {
266
+ loader : require . resolve ( 'babel-loader' ) ,
267
+ options : {
268
+ // @remove -on-eject-begin
269
+ babelrc : false ,
270
+ presets : [ require . resolve ( 'babel-preset-react-app' ) ] ,
271
+ // @remove -on-eject-end
272
+ compact : true ,
273
+ highlightCode : true ,
274
+ } ,
275
+ } ,
276
+ ] ,
277
+ } ,
255
278
// Process application JS with Babel.
256
279
// The preset includes JSX, Flow, and some ESnext features.
257
280
{
Original file line number Diff line number Diff line change 70
70
"webpack" : " 4.8.3" ,
71
71
"webpack-dev-server" : " 3.1.4" ,
72
72
"webpack-manifest-plugin" : " 2.0.3" ,
73
- "whatwg-fetch" : " 2.0.4"
73
+ "whatwg-fetch" : " 2.0.4" ,
74
+ "worker-loader" : " ^1.1.1"
74
75
},
75
76
"devDependencies" : {
76
77
"react" : " ^16.3.2" ,
You can’t perform that action at this time.
0 commit comments