Skip to content

Commit b3b9ac5

Browse files
authored
fix(create-vite): update react-swc template name (#11281)
1 parent 348146f commit b3b9ac5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/create-vite/src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const FRAMEWORKS: Framework[] = [
106106
color: yellow,
107107
},
108108
{
109-
name: 'react-ts-swc',
109+
name: 'react-swc-ts',
110110
display: 'TypeScript + SWC',
111111
color: blue,
112112
},
@@ -304,9 +304,9 @@ async function init() {
304304
// determine template
305305
let template: string = variant || framework?.name || argTemplate
306306
let isReactSwc = false
307-
if (template.endsWith('-swc')) {
307+
if (template.includes('-swc')) {
308308
isReactSwc = true
309-
template = template.slice(0, -4)
309+
template = template.replace('-swc', '')
310310
}
311311

312312
const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent)

0 commit comments

Comments
 (0)