Bugfix watcher function. Refresh bundler after adding and removing pages
This commit is contained in:
@@ -25,13 +25,19 @@ export default async function grabPageComponent({
|
||||
const url = req?.url ? new URL(req.url) : undefined;
|
||||
const router = grabRouter();
|
||||
|
||||
const { BUNX_ROOT_500_PRESET_COMPONENT, BUNX_ROOT_404_PRESET_COMPONENT, PAGES_DIR } = grabDirNames();
|
||||
const {
|
||||
BUNX_ROOT_500_PRESET_COMPONENT,
|
||||
BUNX_ROOT_404_PRESET_COMPONENT,
|
||||
PAGES_DIR,
|
||||
} = grabDirNames();
|
||||
|
||||
const routeParams = req ? await grabRouteParams({ req }) : undefined;
|
||||
|
||||
try {
|
||||
const match = url ? router.match(url.pathname) : undefined;
|
||||
|
||||
console.log("match", match);
|
||||
|
||||
if (!match?.filePath && url?.pathname) {
|
||||
throw new NotFoundError(`Page ${url.pathname} not found`);
|
||||
}
|
||||
@@ -163,7 +169,9 @@ export default async function grabPageComponent({
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<span>{is404 ? "404 Not Found" : "500 Internal Server Error"}</span>
|
||||
<span>
|
||||
{is404 ? "404 Not Found" : "500 Internal Server Error"}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import grabDirNames from "../../../utils/grab-dir-names";
|
||||
import type { BundlerCTXMap, PageDistGenParams } from "../../../types";
|
||||
import grabConstants from "../../../utils/grab-constants";
|
||||
|
||||
const { BUNX_HYDRATION_SRC_DIR } = grabDirNames();
|
||||
|
||||
@@ -9,9 +8,6 @@ type Params = {
|
||||
};
|
||||
|
||||
export default async function ({ bundledMap }: Params) {
|
||||
const { ClientRootElementIDName, ClientRootComponentWindowName } =
|
||||
await grabConstants();
|
||||
|
||||
let script = "";
|
||||
|
||||
// script += `import React from "react";\n`;
|
||||
|
||||
Reference in New Issue
Block a user