Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 0 additions & 14 deletions packages/plugin-react-oxc/build.config.ts

This file was deleted.

9 changes: 5 additions & 4 deletions packages/plugin-react-oxc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
"dist"
],
"type": "module",
"types": "./dist/index.d.mts",
"exports": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": "./dist/index.js",
"scripts": {
"dev": "unbuild --stub",
"build": "unbuild && tsx scripts/copyRefreshRuntime.ts",
"dev": "tsdown --watch",
"build": "tsdown",
"prepublishOnly": "npm run build"
},
"engines": {
Expand All @@ -44,6 +44,7 @@
},
"devDependencies": {
"@vitejs/react-common": "workspace:*",
"tsdown": "^0.12.9",
"unbuild": "^3.5.0",
"vite": "catalog:rolldown-vite"
},
Expand Down
6 changes: 0 additions & 6 deletions packages/plugin-react-oxc/scripts/copyRefreshRuntime.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/plugin-react-oxc/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"include": ["src", "scripts"],
"include": ["src"],
"compilerOptions": {
"outDir": "dist",
"target": "ES2020",
Expand Down
14 changes: 14 additions & 0 deletions packages/plugin-react-oxc/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from 'tsdown'

export default defineConfig({
entry: 'src/index.ts',
define: {
'globalThis.__IS_BUILD__': 'true',
},
copy: [
{
from: 'node_modules/@vitejs/react-common/refresh-runtime.js',
to: 'dist/refresh-runtime.js',
},
],
})
15 changes: 0 additions & 15 deletions packages/plugin-react/build.config.ts

This file was deleted.

13 changes: 6 additions & 7 deletions packages/plugin-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@
],
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.mts",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.mjs",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"scripts": {
"dev": "unbuild --stub",
"build": "unbuild && pnpm run patch-cjs && tsx scripts/copyRefreshRuntime.ts",
"patch-cjs": "tsx ../../scripts/patchCJS.ts",
"dev": "tsdown --watch",
"build": "tsdown",
"prepublishOnly": "npm run build",
"test-unit": "vitest run"
},
Expand Down Expand Up @@ -65,7 +64,7 @@
"react": "^19.1.0",
"react-dom": "^19.1.0",
"rolldown": "1.0.0-beta.24",
"unbuild": "^3.5.0",
"tsdown": "^0.12.9",
"vitest": "^3.2.4"
}
}
6 changes: 0 additions & 6 deletions packages/plugin-react/scripts/copyRefreshRuntime.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/plugin-react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"include": ["src", "scripts"],
"include": ["src"],
"compilerOptions": {
"outDir": "dist",
"target": "ES2020",
Expand Down
21 changes: 21 additions & 0 deletions packages/plugin-react/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineConfig } from 'tsdown'

export default defineConfig({
entry: 'src/index.ts',
format: ['esm', 'cjs'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we go to esm only at the same time?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can do it in a separate PR.

define: {
'globalThis.__IS_BUILD__': 'true',
},
copy: [
{
from: 'node_modules/@vitejs/react-common/refresh-runtime.js',
to: 'dist/refresh-runtime.js',
},
],
outputOptions(outputOpts, format) {
if (format === 'cjs') {
outputOpts.footer = 'module.exports.default = module.exports'
}
return outputOpts
},
})
31 changes: 11 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 0 additions & 57 deletions scripts/patchCJS.ts

This file was deleted.

Loading