@taujs/create-taujs 0.1.2 → 0.1.3
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/index.js +10 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -802,15 +802,22 @@ export const { renderSSR, renderStream } = createRenderer({
|
|
|
802
802
|
`;
|
|
803
803
|
}
|
|
804
804
|
function generateServerIndex() {
|
|
805
|
-
return `import
|
|
805
|
+
return `import path from 'node:path';
|
|
806
|
+
import { createServer } from '@taujs/server';
|
|
806
807
|
import config from '../../taujs.config.ts';
|
|
807
808
|
import { serviceRegistry } from './services/registry.ts';
|
|
808
809
|
|
|
810
|
+
const isDev = process.env.NODE_ENV !== 'production';
|
|
811
|
+
|
|
812
|
+
const clientRoot = isDev
|
|
813
|
+
? path.resolve(process.cwd(), 'src/client') // source for dev + Vite
|
|
814
|
+
: path.resolve(process.cwd(), 'dist/client'); // built assets for prod
|
|
815
|
+
|
|
809
816
|
const { app, net } = await createServer({
|
|
810
817
|
config,
|
|
811
818
|
serviceRegistry,
|
|
812
|
-
clientRoot
|
|
813
|
-
debug:
|
|
819
|
+
clientRoot,
|
|
820
|
+
debug: isDev ? { ssr: true } : false,
|
|
814
821
|
});
|
|
815
822
|
|
|
816
823
|
if (app) {
|