Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSC: No need to patch Vite anymore #9636

Merged
merged 3 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions packages/cli/src/commands/experimental/setupRscHandler.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import fs from 'fs'
import path from 'path'

import execa from 'execa'
import { Listr } from 'listr2'

import { prettify } from '@redwoodjs/cli-helpers'
Expand Down Expand Up @@ -350,46 +349,6 @@ export const handler = async ({ force, verbose }) => {
})
},
},
{
title: 'Patch vite',
task: async () => {
const vitePatchTemplate = fs.readFileSync(
path.resolve(
__dirname,
'templates',
'rsc',
'vite-npm-4.4.9-e845c1bbf8.patch.template'
),
'utf-8'
)

const yarnPatchDir = path.join(rwPaths.base, '.yarn', 'patches')
const vitePatchPath = path.join(
yarnPatchDir,
'vite-npm-4.4.9-e845c1bbf8.patch'
)
writeFile(vitePatchPath, vitePatchTemplate, {
overwriteExisting: force,
})

const packageJsonPath = path.join(rwPaths.base, 'package.json')
const packageJson = JSON.parse(
fs.readFileSync(packageJsonPath, 'utf-8')
)
packageJson.resolutions = packageJson.resolutions || {}
packageJson.resolutions['vite@4.4.9'] =
'patch:vite@npm%3A4.4.9#./.yarn/patches/vite-npm-4.4.9-e845c1bbf8.patch'
writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2), {
overwriteExisting: true,
})

await execa('yarn install', {
stdio: 'ignore',
shell: true,
cwd: rwPaths.base,
})
},
},
{
task: () => {
printTaskEpilogue(command, description, EXPERIMENTAL_TOPIC_ID)
Expand Down

This file was deleted.

Loading