1
-
2
-
3
1
const fs = require ( "fs" ) ;
4
2
const isWsl = require ( "is-wsl" ) ;
5
3
const path = require ( "path" ) ;
@@ -19,14 +17,14 @@ const WorkboxWebpackPlugin = require("workbox-webpack-plugin");
19
17
const WatchMissingNodeModulesPlugin = require ( "react-dev-utils/WatchMissingNodeModulesPlugin" ) ;
20
18
const ModuleScopePlugin = require ( "react-dev-utils/ModuleScopePlugin" ) ;
21
19
const getCSSModuleLocalIdent = require ( "react-dev-utils/getCSSModuleLocalIdent" ) ;
22
- const modules = require ( "./modules" ) ;
23
20
const getClientEnvironment = require ( "./env" ) ;
24
21
const ModuleNotFoundPlugin = require ( "react-dev-utils/ModuleNotFoundPlugin" ) ;
25
22
const ForkTsCheckerWebpackPlugin = require ( "react-dev-utils/ForkTsCheckerWebpackPlugin" ) ;
26
23
const typescriptFormatter = require ( "react-dev-utils/typescriptFormatter" ) ;
27
24
const eslint = require ( "eslint" ) ;
28
25
29
26
const postcssNormalize = require ( "postcss-normalize" ) ;
27
+ const modules = require ( "./modules" ) ;
30
28
const paths = require ( "./paths" ) ;
31
29
32
30
const appPackageJson = require ( paths . appPackageJson ) ;
@@ -471,29 +469,26 @@ module.exports = function(webpackEnv) {
471
469
} ,
472
470
plugins : [
473
471
// Generates an `index.html` file with the <script> injected.
474
- new HtmlWebpackPlugin (
475
- {
476
-
477
- inject : true ,
478
- template : paths . appHtml ,
479
- ...( isEnvProduction
480
- ? {
481
- minify : {
482
- removeComments : true ,
483
- collapseWhitespace : true ,
484
- removeRedundantAttributes : true ,
485
- useShortDoctype : true ,
486
- removeEmptyAttributes : true ,
487
- removeStyleLinkTypeAttributes : true ,
488
- keepClosingSlash : true ,
489
- minifyJS : true ,
490
- minifyCSS : true ,
491
- minifyURLs : true
492
- }
472
+ new HtmlWebpackPlugin ( {
473
+ inject : true ,
474
+ template : paths . appHtml ,
475
+ ...( isEnvProduction
476
+ ? {
477
+ minify : {
478
+ removeComments : true ,
479
+ collapseWhitespace : true ,
480
+ removeRedundantAttributes : true ,
481
+ useShortDoctype : true ,
482
+ removeEmptyAttributes : true ,
483
+ removeStyleLinkTypeAttributes : true ,
484
+ keepClosingSlash : true ,
485
+ minifyJS : true ,
486
+ minifyCSS : true ,
487
+ minifyURLs : true
493
488
}
494
- : undefined )
495
- }
496
- ) ,
489
+ }
490
+ : undefined )
491
+ } ) ,
497
492
// Inlines the webpack runtime script. This script is too small to warrant
498
493
// a network request.
499
494
isEnvProduction && shouldInlineRuntimeChunk && new InlineChunkHtmlPlugin ( HtmlWebpackPlugin , [ / r u n t i m e ~ .+ [ . ] j s / ] ) ,
@@ -561,7 +556,7 @@ module.exports = function(webpackEnv) {
561
556
clientsClaim : true ,
562
557
exclude : [ / \. m a p $ / , / a s s e t - m a n i f e s t \. j s o n $ / ] ,
563
558
importWorkboxFrom : "cdn" ,
564
- navigateFallback : `${ publicUrl } /index.html` ,
559
+ navigateFallback : `${ publicUrl } /index.html` ,
565
560
navigateFallbackBlacklist : [
566
561
// Exclude URLs starting with /_, as they're likely an API call
567
562
new RegExp ( "^/_" ) ,
0 commit comments