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 22
33import path from "node:path";
44import { fileURLToPath } from "node:url";<% if (htmlWebpackPlugin) { %>
5+ import { type Configuration } from "webpack";<% if (devServer) { %>
6+ import " webpack-dev-server" ;<% } %><% } %><% if (htmlWebpackPlugin) { %>
57import HtmlWebpackPlugin from " html-webpack-plugin" ;<% } %><% if (extractPlugin !== "No") { %>
68import MiniCssExtractPlugin from " mini-css-extract-plugin" ;<% } %><% if (workboxWebpackPlugin) { %>
79import WorkboxWebpackPlugin from " workbox-webpack-plugin" ;<% } %>
@@ -14,7 +16,7 @@ const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : "style-loader
1416const stylesHandler = " style-loader" ;<% } %><% } %>
1517
1618/** @type { import(" webpack" ).Configuration} */
17- const config = {
19+ const config <% if (langType === "Typescript") { %> : Configuration <% } %> = {
1820 entry: " <%= entry %>" ,
1921 output: {
2022 path: path.resolve(__dirname, " dist" ),
Original file line number Diff line number Diff line change 22
33import path from "node:path";
44import { fileURLToPath } from "node:url";<% if (htmlWebpackPlugin) { %>
5+ import { type Configuration } from "webpack";<% if (devServer) { %>
6+ import " webpack-dev-server" ;<% } %><% } %><% if (htmlWebpackPlugin) { %>
57import HtmlWebpackPlugin from " html-webpack-plugin" ;<% } %><% if (extractPlugin !== "No") { %>
68import MiniCssExtractPlugin from " mini-css-extract-plugin" ;<% } %><% if (workboxWebpackPlugin) { %>
79import WorkboxWebpackPlugin from " workbox-webpack-plugin" ;<% } %>
@@ -14,7 +16,7 @@ const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : "style-loader
1416const stylesHandler = " style-loader" ;<% } %><% } %>
1517
1618/** @type { import(" webpack" ).Configuration} */
17- const config = {
19+ const config <% if (langType === "Typescript") { %> : Configuration <% } %> = {
1820 entry: " <%= entry %>" ,
1921 output: {
2022 path: path.resolve(__dirname, " dist" ),
Original file line number Diff line number Diff line change 33import { VueLoaderPlugin } from "vue-loader";
44import path from "node:path";
55import { fileURLToPath } from "node:url";<% if (htmlWebpackPlugin) { %>
6+ import { type Configuration } from "webpack";<% if (devServer) { %>
7+ import " webpack-dev-server" ;<% } %><% } %><% if (htmlWebpackPlugin) { %>
68import HtmlWebpackPlugin from " html-webpack-plugin" ;<% } %><% if (extractPlugin !== "No") { %>
79import MiniCssExtractPlugin from " mini-css-extract-plugin" ;<% } %><% if (workboxWebpackPlugin) { %>
810import WorkboxWebpackPlugin from " workbox-webpack-plugin" ;<% } %>
@@ -21,7 +23,7 @@ const stylesHandler = "vue-style-loader";
2123<% } %>
2224
2325/** @type { import(" webpack" ).Configuration} */
24- const config = {
26+ const config <% if (langType === "Typescript") { %> : Configuration <% } %> = {
2527 entry: " <%= entry %>" ,
2628 output: {
2729 path: path.resolve(__dirname, " dist" ),
You can’t perform that action at this time.
0 commit comments