Skip to content

Commit

Permalink
fix(create-vite): update react-swc template name (vitejs#11281)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored and futurGH committed Feb 26, 2023
1 parent 508057e commit ac45e46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/create-vite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const FRAMEWORKS: Framework[] = [
color: yellow,
},
{
name: 'react-ts-swc',
name: 'react-swc-ts',
display: 'TypeScript + SWC',
color: blue,
},
Expand Down Expand Up @@ -304,9 +304,9 @@ async function init() {
// determine template
let template: string = variant || framework?.name || argTemplate
let isReactSwc = false
if (template.endsWith('-swc')) {
if (template.includes('-swc')) {
isReactSwc = true
template = template.slice(0, -4)
template = template.replace('-swc', '')
}

const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent)
Expand Down

0 comments on commit ac45e46

Please sign in to comment.