Skip to content
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
7 changes: 3 additions & 4 deletions apps/vite-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,22 @@
"example-ui": "0.0.55",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"vite-plugin-babel": "^1.3.2",
"vite-plugin-babel": "^1.7.1",
"react-strict-dom": "0.0.55"
},
"devDependencies": {
"autoprefixer": "^10.4.22",
"vite-tsconfig-paths": "^5.1.4",
"@eslint/js": "^9.39.1",
"@types/node": "^24.10.1",
"@types/react": "^19.2.5",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.1",
"@vitejs/plugin-react": "^6.0.2",
"eslint": "^9.39.1",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.4.24",
"globals": "^16.5.0",
"typescript": "~5.9.3",
"typescript-eslint": "^8.46.4",
"vite": "^7.2.4"
"vite": "^8.0.13"
}
}
7 changes: 4 additions & 3 deletions apps/vite-app/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ export default {
plugins: {
'react-strict-dom/postcss-plugin': {
include: [
'src/**/*.{js,jsx,ts,tsx}',
'../../node_modules/example-ui/**/*.jsx'
'src/**/*.{js,jsx,mjs,ts,tsx}',
'../../node_modules/example-ui/**/*.{js,jsx,mjs}'
],
babelConfig
babelConfig,
useLayers: true
},
autoprefixer: {}
}
Expand Down
57 changes: 36 additions & 21 deletions apps/vite-app/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,45 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tsConfigPaths from "vite-tsconfig-paths";
import babel from "vite-plugin-babel";
import viteReact from "@vitejs/plugin-react";
import viteBabel from "vite-plugin-babel";

const webOnlyExtensions = [".web.js", ".web.jsx", ".web.ts", ".web.tsx"];
const allExtensions = [
...webOnlyExtensions,
".mjs",
".js",
".mts",
".ts",
".jsx",
".tsx",
".json",
];

// On Vite 8, @vitejs/plugin-react@6 no longer runs Babel, so vite-plugin-babel
// must apply react-strict-dom/babel-preset to app source and to any package
// that ships React Strict DOM UI (here, example-ui).
const babelInclude = [
/[\\/]src[\\/]/,
/[\\/]example-ui[\\/]/,
/[\\/]react-strict-dom[\\/]/,
];

export default defineConfig(() => ({
resolve: {
extensions: [
...webOnlyExtensions,
".mjs",
".js",
".mts",
".ts",
".jsx",
".tsx",
".json",
],
},
plugins: [
tsConfigPaths(),
react({
babel: {
configFile: true,
},
viteReact(),
viteBabel({
include: babelInclude,
filter: /\.[cm]?[jt]sx?$/,
}),
babel(),
],
resolve: {
// Native in Vite 8 — replaces the vite-tsconfig-paths plugin.
tsconfigPaths: true,
extensions: allExtensions,
},
optimizeDeps: {
// Vite 8's dependency optimizer is Rolldown, not esbuild.
rolldownOptions: {
resolve: { extensions: allExtensions },
},
},
}));
Loading
Loading