Skip to content

Commit

Permalink
fix: put back ssr with experimental.skipSsrTransform (otherwise `vite…
Browse files Browse the repository at this point in the history
… build --ssr` stuck?)
  • Loading branch information
hi-ogawa committed Nov 23, 2023
1 parent 9649e5b commit d1cdc12
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/remix-dev/vite/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ const getRouteModuleExports = async (
let routePath = path.join(pluginConfig.appDirectory, routeFile);
let url = resolveFileUrl(pluginConfig, routePath);

let transformed = await viteChildCompiler.transformRequest(url);
let transformed = await viteChildCompiler.transformRequest(url, {
ssr: true,
});
invariant(transformed, "Failed to transform: " + routeFile);
let [, exports] = esModuleLexer(transformed.code);
let exportNames = exports.map((e) => e.n);
Expand Down Expand Up @@ -611,6 +613,9 @@ export const remixVitePlugin: RemixVitePlugin = (options = {}) => {

viteChildCompiler = await vite.createServer({
...viteUserConfig,
experimental: {
skipSsrTransform: true,
},
mode: viteConfig.mode,
server: {
hmr: false,
Expand Down

0 comments on commit d1cdc12

Please sign in to comment.