Skip to content

Commit 1a0f0b4

Browse files
fix(generator): generate a ts confi file
-Add ts-node to load the configuration file
1 parent bd8b25a commit 1a0f0b4

File tree

1 file changed

+5
-2
lines changed
  • packages/create-webpack-app/src/generators/init

1 file changed

+5
-2
lines changed

packages/create-webpack-app/src/generators/init/default.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export default async function defaultInitGenerator(plop: NodePlopAPI) {
105105
devDependencies.push("babel-loader", "@babel/core", "@babel/preset-env");
106106
break;
107107
case "Typescript":
108-
devDependencies.push("typescript", "ts-loader");
108+
devDependencies.push("typescript", "ts-loader", "ts-node");
109109
break;
110110
}
111111

@@ -149,7 +149,10 @@ export default async function defaultInitGenerator(plop: NodePlopAPI) {
149149

150150
const files: FileRecord[] = [
151151
{ filePath: "./index.html", fileType: "text" },
152-
{ filePath: "webpack.config.js", fileType: "text" },
152+
{
153+
filePath: answers.langType === "Typescript" ? "webpack.config.ts" : "webpack.config.js",
154+
fileType: "text",
155+
},
153156
{ filePath: "package.json", fileType: "text" },
154157
{ filePath: "README.md", fileType: "text" },
155158
];

0 commit comments

Comments
 (0)