vorzelajs 0.0.4 → 0.0.5
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/cli/dev.d.ts.map +1 -1
- package/dist/cli/dev.js +11 -1
- package/package.json +1 -1
package/dist/cli/dev.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/cli/dev.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/cli/dev.ts"],"names":[],"mappings":"AAgEA,wBAAsB,MAAM,kBAqE3B"}
|
package/dist/cli/dev.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { createServer } from 'node:http';
|
|
2
2
|
import { createServer as createNetServer } from 'node:net';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import url from 'node:url';
|
|
3
5
|
import { getRequestListener } from '@hono/node-server';
|
|
4
6
|
import { createVorzelaApp } from '../server/index.js';
|
|
5
7
|
import { resolveVorzelaConfig } from '../vite/index.js';
|
|
@@ -48,6 +50,11 @@ export async function runDev() {
|
|
|
48
50
|
const { vorzelaServerOnlyPlugin } = await import('../vite/server-only.js');
|
|
49
51
|
const solidPlugin = await import('vite-plugin-solid').then((m) => m.default).catch(() => null);
|
|
50
52
|
const baseConfig = await resolveVorzelaConfig(appRoot);
|
|
53
|
+
// Resolve the framework's internal entry-client file
|
|
54
|
+
const devThisFile = url.fileURLToPath(import.meta.url);
|
|
55
|
+
const frameworkDir = path.resolve(path.dirname(devThisFile), '..');
|
|
56
|
+
const internalExt = path.extname(devThisFile) === '.js' ? '.jsx' : '.tsx';
|
|
57
|
+
const entryClientPath = path.resolve(frameworkDir, `internal/entry-client${internalExt}`);
|
|
51
58
|
const { createServer: createViteServer } = await import('vite');
|
|
52
59
|
const resolvedHmrPort = await findAvailablePort(hmrPort);
|
|
53
60
|
const vite = await createViteServer({
|
|
@@ -58,11 +65,14 @@ export async function runDev() {
|
|
|
58
65
|
port: resolvedHmrPort,
|
|
59
66
|
},
|
|
60
67
|
middlewareMode: true,
|
|
68
|
+
fs: {
|
|
69
|
+
allow: [appRoot, frameworkDir],
|
|
70
|
+
},
|
|
61
71
|
},
|
|
62
72
|
});
|
|
63
73
|
const devAssets = {
|
|
64
74
|
css: ['/src/styles.css'],
|
|
65
|
-
js: [
|
|
75
|
+
js: [`/@fs/${entryClientPath}`],
|
|
66
76
|
};
|
|
67
77
|
const loadEntry = async () => {
|
|
68
78
|
return vite.ssrLoadModule('virtual:vorzela/entry-server');
|