File tree Expand file tree Collapse file tree
packages/create-webpack-app/templates/init Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,8 +85,8 @@ const config <% if (langType === "Typescript") { %>: Configuration <% } %>= {
8585export default () => {
8686 if (isProduction) {
8787 config.mode = " production" ;<% if (extractPlugin === " Only for Production" ) { %>
88- config.plugins! .push(new MiniCssExtractPlugin());<% } %><% if (workboxWebpackPlugin) { %>
89- config.plugins! .push(new WorkboxWebpackPlugin.GenerateSW());<% } %>
88+ config.plugins? .push(new MiniCssExtractPlugin());<% } %><% if (workboxWebpackPlugin) { %>
89+ config.plugins? .push(new WorkboxWebpackPlugin.GenerateSW());<% } %>
9090 } else {
9191 config.mode = " development" ;
9292 }
Original file line number Diff line number Diff line change @@ -89,8 +89,8 @@ const config <% if (langType === "Typescript") { %>: Configuration <% } %>= {
8989export default () => {
9090 if (isProduction) {
9191 config.mode = " production" ;<% if (extractPlugin === " Only for Production" ) { %>
92- config.plugins.push(new MiniCssExtractPlugin());<% } %><% if (workboxWebpackPlugin) { %>
93- config.plugins.push(new WorkboxWebpackPlugin.GenerateSW());<% } %>
92+ config.plugins? .push(new MiniCssExtractPlugin());<% } %><% if (workboxWebpackPlugin) { %>
93+ config.plugins? .push(new WorkboxWebpackPlugin.GenerateSW());<% } %>
9494 } else {
9595 config.mode = " development" ;
9696 }
Original file line number Diff line number Diff line change @@ -103,8 +103,8 @@ const config <% if (langType === "Typescript") { %>: Configuration <% } %>= {
103103export default () => {
104104 if (isProduction) {
105105 config.mode = " production" ;<% if (extractPlugin === " Only for Production" ) { %>
106- config.plugins.push(new MiniCssExtractPlugin());<% } %><% if (workboxWebpackPlugin) { %>
107- config.plugins.push(new WorkboxWebpackPlugin.GenerateSW());<% } %>
106+ config.plugins? .push(new MiniCssExtractPlugin());<% } %><% if (workboxWebpackPlugin) { %>
107+ config.plugins? .push(new WorkboxWebpackPlugin.GenerateSW());<% } %>
108108 } else {
109109 config.mode = " development" ;
110110 }
Original file line number Diff line number Diff line change 99 " esModuleInterop" : true ,
1010 " allowSyntheticDefaultImports" : true ,
1111 " sourceMap" : true ,
12- " baseUrl" : " ." ,
1312 " verbatimModuleSyntax" : true ,
1413 " erasableSyntaxOnly" : true ,
1514 " isolatedModules" : true ,
Original file line number Diff line number Diff line change @@ -98,8 +98,8 @@ const config <% if (langType === "Typescript") { %>: Configuration <% } %>= {
9898export default () => {
9999 if (isProduction) {
100100 config.mode = " production" ;<% if (extractPlugin === " Only for Production" ) { %>
101- config.plugins.push(new MiniCssExtractPlugin());<% } %><% if (workboxWebpackPlugin) { %>
102- config.plugins.push(new WorkboxWebpackPlugin.GenerateSW());<% } %>
101+ config.plugins? .push(new MiniCssExtractPlugin());<% } %><% if (workboxWebpackPlugin) { %>
102+ config.plugins? .push(new WorkboxWebpackPlugin.GenerateSW());<% } %>
103103 } else {
104104 config.mode = " development" ;
105105 }
You can’t perform that action at this time.
0 commit comments