@@ -218,115 +218,80 @@ module.exports = {
218
218
{
219
219
test : / \. ( j s | j s x ) $ / ,
220
220
include : paths . appSrc ,
221
- use : [
222
- // This loader parallelizes code compilation, it is optional but
223
- // improves compile time on larger projects
224
- {
225
- loader : require . resolve ( 'thread-loader' ) ,
226
- options : {
227
- poolTimeout : Infinity , // keep workers alive for more effective watch mode
228
- // Forwards the process args (such as --require) to the child
229
- // workers. Ensures that the worker operates in the same kind
230
- // of environment than the current one (important in case a
231
- // preloaded script modifies the env)
232
- workerNodeArgs : process . execArgv ,
233
- } ,
234
- } ,
235
- {
236
- loader : require . resolve ( 'babel-loader' ) ,
237
- options : {
238
- customize : require . resolve (
239
- 'babel-preset-react-app/webpack-overrides'
240
- ) ,
241
- // @remove -on-eject-begin
242
- babelrc : false ,
243
- configFile : false ,
244
- presets : [ require . resolve ( 'babel-preset-react-app' ) ] ,
245
- // Make sure we have a unique cache identifier, erring on the
246
- // side of caution.
247
- // We remove this when the user ejects because the default
248
- // is sane and uses Babel options. Instead of options, we use
249
- // the react-scripts and babel-preset-react-app versions.
250
- cacheIdentifier : getCacheIdentifier ( 'development' , [
251
- 'babel-plugin-named-asset-import' ,
252
- 'babel-preset-react-app' ,
253
- 'react-dev-utils' ,
254
- 'react-scripts' ,
255
- ] ) ,
256
- // @remove -on-eject-end
257
- plugins : [
258
- [
259
- require . resolve ( 'babel-plugin-named-asset-import' ) ,
260
- {
261
- loaderMap : {
262
- svg : {
263
- ReactComponent :
264
- '@svgr/webpack?-prettier,-svgo![path]' ,
265
- } ,
266
- } ,
221
+ loader : require . resolve ( 'babel-loader' ) ,
222
+ options : {
223
+ customize : require . resolve (
224
+ 'babel-preset-react-app/webpack-overrides'
225
+ ) ,
226
+ // @remove -on-eject-begin
227
+ babelrc : false ,
228
+ configFile : false ,
229
+ presets : [ require . resolve ( 'babel-preset-react-app' ) ] ,
230
+ // Make sure we have a unique cache identifier, erring on the
231
+ // side of caution.
232
+ // We remove this when the user ejects because the default
233
+ // is sane and uses Babel options. Instead of options, we use
234
+ // the react-scripts and babel-preset-react-app versions.
235
+ cacheIdentifier : getCacheIdentifier ( 'development' , [
236
+ 'babel-plugin-named-asset-import' ,
237
+ 'babel-preset-react-app' ,
238
+ 'react-dev-utils' ,
239
+ 'react-scripts' ,
240
+ ] ) ,
241
+ // @remove -on-eject-end
242
+ plugins : [
243
+ [
244
+ require . resolve ( 'babel-plugin-named-asset-import' ) ,
245
+ {
246
+ loaderMap : {
247
+ svg : {
248
+ ReactComponent : '@svgr/webpack?-prettier,-svgo![path]' ,
267
249
} ,
268
- ] ,
269
- ] ,
270
- // This is a feature of `babel-loader` for webpack (not Babel itself).
271
- // It enables caching results in ./node_modules/.cache/babel-loader/
272
- // directory for faster rebuilds .
273
- cacheDirectory : true ,
274
- // Don't waste time on Gzipping the cache
275
- cacheCompression : false ,
276
- } ,
277
- } ,
278
- ] ,
250
+ } ,
251
+ } ,
252
+ ] ,
253
+ ] ,
254
+ // This is a feature of `babel-loader` for webpack (not Babel itself) .
255
+ // It enables caching results in ./node_modules/.cache/babel-loader/
256
+ // directory for faster rebuilds.
257
+ cacheDirectory : true ,
258
+ // Don't waste time on Gzipping the cache
259
+ cacheCompression : false ,
260
+ } ,
279
261
} ,
280
262
// Process any JS outside of the app with Babel.
281
263
// Unlike the application JS, we only compile the standard ES features.
282
264
{
283
265
test : / \. j s $ / ,
284
266
exclude : / @ b a b e l (?: \/ | \\ { 1 , 2 } ) r u n t i m e / ,
285
- use : [
286
- // This loader parallelizes code compilation, it is optional but
287
- // improves compile time on larger projects
288
- {
289
- loader : require . resolve ( 'thread-loader' ) ,
290
- options : {
291
- poolTimeout : Infinity , // keep workers alive for more effective watch mode
292
- // Forwards the process args (such as --require) to the child
293
- // workers. Ensures that the worker operates in the same kind
294
- // of environment than the current one (important in case a
295
- // preloaded script modifies the env)
296
- workerNodeArgs : process . execArgv ,
297
- } ,
298
- } ,
299
- {
300
- loader : require . resolve ( 'babel-loader' ) ,
301
- options : {
302
- babelrc : false ,
303
- configFile : false ,
304
- compact : false ,
305
- presets : [
306
- [
307
- require . resolve ( 'babel-preset-react-app/dependencies' ) ,
308
- { helpers : true } ,
309
- ] ,
310
- ] ,
311
- cacheDirectory : true ,
312
- // Don't waste time on Gzipping the cache
313
- cacheCompression : false ,
314
- // @remove -on-eject-begin
315
- cacheIdentifier : getCacheIdentifier ( 'development' , [
316
- 'babel-plugin-named-asset-import' ,
317
- 'babel-preset-react-app' ,
318
- 'react-dev-utils' ,
319
- 'react-scripts' ,
320
- ] ) ,
321
- // @remove -on-eject-end
322
- // If an error happens in a package, it's possible to be
323
- // because it was compiled. Thus, we don't want the browser
324
- // debugger to show the original code. Instead, the code
325
- // being evaluated would be much more helpful.
326
- sourceMaps : false ,
327
- } ,
328
- } ,
329
- ] ,
267
+ loader : require . resolve ( 'babel-loader' ) ,
268
+ options : {
269
+ babelrc : false ,
270
+ configFile : false ,
271
+ compact : false ,
272
+ presets : [
273
+ [
274
+ require . resolve ( 'babel-preset-react-app/dependencies' ) ,
275
+ { helpers : true } ,
276
+ ] ,
277
+ ] ,
278
+ cacheDirectory : true ,
279
+ // Don't waste time on Gzipping the cache
280
+ cacheCompression : false ,
281
+ // @remove -on-eject-begin
282
+ cacheIdentifier : getCacheIdentifier ( 'development' , [
283
+ 'babel-plugin-named-asset-import' ,
284
+ 'babel-preset-react-app' ,
285
+ 'react-dev-utils' ,
286
+ 'react-scripts' ,
287
+ ] ) ,
288
+ // @remove -on-eject-end
289
+ // If an error happens in a package, it's possible to be
290
+ // because it was compiled. Thus, we don't want the browser
291
+ // debugger to show the original code. Instead, the code
292
+ // being evaluated would be much more helpful.
293
+ sourceMaps : false ,
294
+ } ,
330
295
} ,
331
296
// "postcss" loader applies autoprefixer to our CSS.
332
297
// "css" loader resolves paths in CSS and adds assets as dependencies.
0 commit comments