@@ -107,8 +107,6 @@ const config = {
107107export default () => {
108108 if (isProduction) {
109109 config.mode = "production";
110-
111-
112110 } else {
113111 config.mode = "development";
114112 }
@@ -184,8 +182,6 @@ const config = {
184182export default () => {
185183 if (isProduction) {
186184 config.mode = "production";
187-
188-
189185 } else {
190186 config.mode = "development";
191187 }
@@ -263,10 +259,7 @@ const config = {
263259export default () => {
264260 if (isProduction) {
265261 config.mode = "production";
266-
267-
268- config.plugins.push(new WorkboxWebpackPlugin.GenerateSW());
269-
262+ config.plugins!.push(new WorkboxWebpackPlugin.GenerateSW());
270263 } else {
271264 config.mode = "development";
272265 }
@@ -338,8 +331,6 @@ const config = {
338331export default () => {
339332 if (isProduction) {
340333 config.mode = "production";
341-
342-
343334 } else {
344335 config.mode = "development";
345336 }
@@ -422,10 +413,7 @@ const config = {
422413export default () => {
423414 if (isProduction) {
424415 config.mode = "production";
425-
426-
427- config.plugins.push(new WorkboxWebpackPlugin.GenerateSW());
428-
416+ config.plugins!.push(new WorkboxWebpackPlugin.GenerateSW());
429417 } else {
430418 config.mode = "development";
431419 }
@@ -508,10 +496,7 @@ const config = {
508496export default () => {
509497 if (isProduction) {
510498 config.mode = "production";
511-
512-
513- config.plugins.push(new WorkboxWebpackPlugin.GenerateSW());
514-
499+ config.plugins!.push(new WorkboxWebpackPlugin.GenerateSW());
515500 } else {
516501 config.mode = "development";
517502 }
@@ -592,10 +577,7 @@ const config = {
592577export default () => {
593578 if (isProduction) {
594579 config.mode = "production";
595-
596-
597- config.plugins.push(new WorkboxWebpackPlugin.GenerateSW());
598-
580+ config.plugins!.push(new WorkboxWebpackPlugin.GenerateSW());
599581 } else {
600582 config.mode = "development";
601583 }
@@ -678,10 +660,7 @@ const config = {
678660export default () => {
679661 if (isProduction) {
680662 config.mode = "production";
681-
682-
683- config.plugins.push(new WorkboxWebpackPlugin.GenerateSW());
684-
663+ config.plugins!.push(new WorkboxWebpackPlugin.GenerateSW());
685664 } else {
686665 config.mode = "development";
687666 }
@@ -764,10 +743,7 @@ const config = {
764743export default () => {
765744 if (isProduction) {
766745 config.mode = "production";
767-
768-
769- config.plugins.push(new WorkboxWebpackPlugin.GenerateSW());
770-
746+ config.plugins!.push(new WorkboxWebpackPlugin.GenerateSW());
771747 } else {
772748 config.mode = "development";
773749 }
@@ -1097,14 +1073,15 @@ exports[`create-webpack-app cli should generate typescript project correctly 2`]
10971073
10981074import path from "node:path";
10991075import { fileURLToPath } from "node:url";
1076+ import { type Configuration } from "webpack";
11001077
11011078const __filename = fileURLToPath(import.meta.url);
11021079const __dirname = path.dirname(__filename);
11031080const isProduction = process.env.NODE_ENV === "production";
11041081
11051082
11061083/** @type {import("webpack").Configuration} */
1107- const config = {
1084+ const config : Configuration = {
11081085 entry: "./src/index.ts",
11091086 output: {
11101087 path: path.resolve(__dirname, "dist"),
@@ -1138,8 +1115,6 @@ const config = {
11381115export default () => {
11391116 if (isProduction) {
11401117 config.mode = "production";
1141-
1142-
11431118 } else {
11441119 config.mode = "development";
11451120 }
@@ -1315,7 +1290,6 @@ const isProduction = process.env.NODE_ENV === "production";
13151290const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : "style-loader";
13161291
13171292
1318-
13191293/** @type {import("webpack").Configuration} */
13201294const config = {
13211295 entry: "./src/index.js",
@@ -1351,10 +1325,7 @@ const config = {
13511325export default () => {
13521326 if (isProduction) {
13531327 config.mode = "production";
1354-
1355- config.plugins.push(new MiniCssExtractPlugin());
1356-
1357-
1328+ config.plugins!.push(new MiniCssExtractPlugin());
13581329 } else {
13591330 config.mode = "development";
13601331 }
@@ -1404,7 +1375,6 @@ const isProduction = process.env.NODE_ENV === "production";
14041375const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : "style-loader";
14051376
14061377
1407-
14081378/** @type {import("webpack").Configuration} */
14091379const config = {
14101380 entry: "./src/index.js",
@@ -1436,10 +1406,7 @@ const config = {
14361406export default () => {
14371407 if (isProduction) {
14381408 config.mode = "production";
1439-
1440- config.plugins.push(new MiniCssExtractPlugin());
1441-
1442-
1409+ config.plugins!.push(new MiniCssExtractPlugin());
14431410 } else {
14441411 config.mode = "development";
14451412 }
0 commit comments