@webjourney/vite-plugins 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +4 -1
- package/package.json +1 -1
package/dist/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,iBA4BvD"}
|
package/dist/build.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { execSync } from 'node:child_process';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
2
3
|
import fs from 'node:fs';
|
|
3
4
|
import path from 'node:path';
|
|
4
5
|
import { JSDOM } from 'jsdom';
|
|
@@ -81,7 +82,9 @@ async function prerender(projectRoot) {
|
|
|
81
82
|
const entryServerPath = toAbsolute('dist-ssr/entry-server.js');
|
|
82
83
|
const { render } = await import(entryServerPath);
|
|
83
84
|
// Dynamically import renderToString from the project's react-dom
|
|
84
|
-
|
|
85
|
+
// Use createRequire to properly resolve in hoisted workspaces
|
|
86
|
+
const require = createRequire(path.join(projectRoot, 'package.json'));
|
|
87
|
+
const reactDomServerPath = require.resolve('react-dom/server');
|
|
85
88
|
const { renderToString } = await import(reactDomServerPath);
|
|
86
89
|
// Extract routes from App.tsx
|
|
87
90
|
const routes = await extractRoutes(projectRoot);
|