Skip to content

Commit 9ffd86d

Browse files
authored
fix(react): use development jsx transform for NODE_ENV=development build (#649)
1 parent aca6a5e commit 9ffd86d

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

packages/plugin-react/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ When used with rolldown-vite, this plugin now uses Oxc for react refresh transfo
88

99
Since this behavior is what `@vitejs/plugin-react-oxc` did, `@vitejs/plugin-react-oxc` is now deprecated and the `disableOxcRecommendation` option is removed.
1010

11+
Also, while `@vitejs/plugin-react-oxc` used the production JSX transform even for `NODE_ENV=development` build, `@vitejs/plugin-react` uses the development JSX transform for `NODE_ENV=development` build.
12+
1113
### Allow processing files in `node_modules`
1214

1315
The default value of `exclude` options is now `[/\/node_modules\//]` to allow processing files in `node_modules` directory. It was previously `[]` and files in `node_modules` was always excluded regardless of the value of `exclude` option.

packages/plugin-react/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ export default function viteReact(opts: Options = {}): Plugin[] {
155155
runtime: 'automatic',
156156
importSource: jsxImportSource,
157157
refresh: command === 'serve',
158-
development: command === 'serve',
159158
},
160159
jsxRefreshInclude: include,
161160
jsxRefreshExclude: exclude,

packages/plugin-rsc/e2e/starter.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { expect, test } from '@playwright/test'
22
import { useFixture } from './fixture'
33
import { defineStarterTest } from './starter'
44
import { waitForHydration } from './helper'
5-
import * as vite from 'vite'
65

76
test.describe('dev-default', () => {
87
const f = useFixture({ root: 'examples/starter', mode: 'dev' })
@@ -25,8 +24,6 @@ test.describe('build-cloudflare', () => {
2524
})
2625

2726
test.describe('dev-production', () => {
28-
test.skip('rolldownVersion' in vite)
29-
3027
const f = useFixture({
3128
root: 'examples/starter',
3229
mode: 'dev',
@@ -45,8 +42,6 @@ test.describe('dev-production', () => {
4542
})
4643

4744
test.describe('build-development', () => {
48-
test.skip('rolldownVersion' in vite)
49-
5045
const f = useFixture({
5146
root: 'examples/starter',
5247
mode: 'build',

playground/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"include": ["*.ts", "**/__tests__/*.ts", "**/vite.config.ts"],
2+
"include": ["*.ts", "**/__tests__/**/*", "**/vite.config.ts"],
33
"exclude": ["**/dist/**"],
44
"compilerOptions": {
55
"target": "ES2023",

0 commit comments

Comments
 (0)