Skip to content

Commit

Permalink
ci: update react-swc plugin version in create-vite by renovate (vitej…
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored Feb 13, 2025
1 parent 367cec1 commit 0f058a9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@
// breaking changes
"kill-port", // `kill-port:^2.0.0 has perf issues (#8392)
],
"customManagers": [
{
"customType": "regex",
"fileMatch": ["packages\/create-vite\/src\/index\\.ts$"],
"matchStrings": [
"\/\/\\s*renovate:\\s+datasource=(?<datasource>\\S+)\\s+depName=(?<depName>\\S+)\\s+(?:var|let|const)\\s+\\S+\\s*=\\s*[\"'](?<currentValue>[^\"']+)[\"']",
],
},
],
}
5 changes: 4 additions & 1 deletion packages/create-vite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,13 @@ function pkgFromUserAgent(userAgent: string | undefined): PkgInfo | undefined {
}

function setupReactSwc(root: string, isTs: boolean) {
// renovate: datasource=npm depName=@vitejs/plugin-react-swc
const reactSwcPluginVersion = '3.7.2'

editFile(path.resolve(root, 'package.json'), (content) => {
return content.replace(
/"@vitejs\/plugin-react": ".+?"/,
`"@vitejs/plugin-react-swc": "^3.7.2"`,
`"@vitejs/plugin-react-swc": "^${reactSwcPluginVersion}"`,
)
})
editFile(
Expand Down

0 comments on commit 0f058a9

Please sign in to comment.