@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.
Files changed (2) hide show
  1. package/dist/index.js +10 -3
  2. 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 { createServer } from '@taujs/server';
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: './src/client',
813
- debug: !!process.env.DEBUG,
819
+ clientRoot,
820
+ debug: isDev ? { ssr: true } : false,
814
821
  });
815
822
 
816
823
  if (app) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taujs/create-taujs",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Scaffold a new τjs application",
5
5
  "author": "Aoede <taujs@aoede.uk.net> (https://www.aoede.uk.net)",
6
6
  "homepage": "https://taujs.dev/",