1.4.1: nested pages dirs, CommonJS require of react in client bundles
- Page URL paths are now relative to src/pages. The old greedy
`.*/pages/` cut mapped src/pages/admin/pages/index.tsx to /index, so
every page under a nested `pages` directory collided with the home page
and was never bundled. SSR also tells API routes by URL path now.
- CommonJS `require("react…")` in client bundles (for example
use-sync-external-store/shim, pulled in by MUI) threw "Dynamic require
of "react" is not supported" in the browser. Those requires now go
through a small bundled ESM module that imports the external.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+1
-1
@@ -46,7 +46,7 @@ async function computeEntryToPage() {
|
||||
}
|
||||
catch (error) { }
|
||||
for (const page of pages) {
|
||||
if (page.local_path.match(/\/pages\/api\//) ||
|
||||
if (page.url_path.startsWith("/api/") ||
|
||||
page.local_path.match(/\.server\.tsx?$/)) {
|
||||
const ts = await Bun.file(page.local_path).text();
|
||||
if (ts.match(/(export default)|(export \w+ handler)|(export \w+ server)/)) {
|
||||
|
||||
Reference in New Issue
Block a user