-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vite: importing @remix-run/dev/server-build
doesn't work
#8122
Comments
@remix-run/dev/server-build
doesn't not work@remix-run/dev/server-build
doesn't work
@remix-run/dev/server-build
doesn't work@remix-run/dev/server-build
doesn't work
Though I initially thought this use case is important, I started to feel such inherently circular nature of server build usage might not be recommended. For this specific use case of https://stackblitz.com/edit/remix-run-remix-ndtuuf?file=generate-sitemap.mjs // Usage:
// npm run build
// node generate-sitemap.mjs > public/sitemap.xml
import * as build from "./build/index.js";
import { getSitemapXml } from "@nasa-gcn/remix-seo/build/sitemap/utils.js";
const sitemap = await getSitemapXml(
new Request("https://dummy.local"),
build.routes,
{
siteUrl: "https://dummy.local"
}
);
console.log(sitemap); |
We don't have plans to support But if you wanted to get a programmatic reference to the build (not the build module ID), you can dynamically import it: let build = await import("./build/server/index.js") We should also emit |
Reproduction
Based on the question asked on the discord, I created a reproduction:
@nasa-gcn/remix-seo
package: https://github.com/nasa-gcn/remix-seoCurrently
@remix-run/dev/server-build
is not exposed yet, but I think it's accessible fromvirtual:server-entry
:The error looks like this:
System Info
From stackblitz:
Used Package Manager
npm
Expected Behavior
@remix-run/dev/server-build
should work same as before on Vite.Actual Behavior
@remix-run/dev/server-build
doesn't work on Vite.The text was updated successfully, but these errors were encountered: