Skip to content

Commit

Permalink
RSC: No need to patch Vite anymore (#9636)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe authored Dec 6, 2023
1 parent 4937929 commit 2fdb496
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 60 deletions.
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.

0 comments on commit 2fdb496

Please sign in to comment.