Skip to content

Commit 0fc6e9d

Browse files
feat(typescript): delete unecessary loader & deps
\n Node22 natively support typescript
1 parent 018effa commit 0fc6e9d

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
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", "ts-node");
108+
devDependencies.push("typescript", "ts-loader");
109109
break;
110110
}
111111

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<% const nodeOptions = langType === "Typescript" ? "NODE_OPTIONS='--loader ts-node/esm --no-warnings' " : ""; %>{
1+
{
22
"version": "1.0.0",
33
"description": "My webpack project",
44
"name": "webpack-project",
55
"type": "module",
66
"scripts": {
7-
"build": "<%- nodeOptions %>webpack --mode=production --config-node-env=production <%- langType === 'Typescript' ? ' -c ./webpack.config.ts' : '' %>",
8-
"build:dev": "<%- nodeOptions %>webpack --mode=development <%- langType === 'Typescript' ? ' -c ./webpack.config.ts' : '' %>",
7+
"build": "webpack --mode=production --config-node-env=production",
8+
"build:dev": "webpack --mode=development",
99
<% if (devServer) { %>
10-
"serve": "<%- nodeOptions %>webpack serve <%- langType === 'Typescript' ? ' -c ./webpack.config.ts' : '' %>",
10+
"serve": "webpack serve",
1111
<% } %>
12-
"watch": "<%- nodeOptions %>webpack --watch <%- langType === 'Typescript' ? ' -c ./webpack.config.ts' : '' %>"
12+
"watch": "webpack --watch"
1313
}
1414
}

0 commit comments

Comments
 (0)