@taujs/create-taujs 0.1.3 → 0.1.4
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 +5 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -238,19 +238,13 @@ function generatePackageJson(projectName, packageManager) {
|
|
|
238
238
|
}
|
|
239
239
|
function generateBuildTs() {
|
|
240
240
|
return `import path from "node:path";
|
|
241
|
-
import { fileURLToPath } from "node:url";
|
|
242
|
-
|
|
243
241
|
import { taujsBuild } from "@taujs/server";
|
|
244
|
-
|
|
245
|
-
import config from "./taujs.config.ts";
|
|
246
|
-
|
|
247
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
242
|
+
import config from "./taujs.config.js";
|
|
248
243
|
|
|
249
244
|
await taujsBuild({
|
|
250
|
-
clientBaseDir: path.resolve(
|
|
245
|
+
clientBaseDir: path.resolve(process.cwd(), "src/client"),
|
|
251
246
|
config,
|
|
252
|
-
projectRoot:
|
|
253
|
-
mode: process.env.BUILD_MODE === 'ssr' ? 'ssr' : 'client',
|
|
247
|
+
projectRoot: process.cwd(),
|
|
254
248
|
});
|
|
255
249
|
`;
|
|
256
250
|
}
|
|
@@ -802,21 +796,15 @@ export const { renderSSR, renderStream } = createRenderer({
|
|
|
802
796
|
`;
|
|
803
797
|
}
|
|
804
798
|
function generateServerIndex() {
|
|
805
|
-
return `import
|
|
806
|
-
import { createServer } from '@taujs/server';
|
|
799
|
+
return `import { createServer } from '@taujs/server';
|
|
807
800
|
import config from '../../taujs.config.ts';
|
|
808
801
|
import { serviceRegistry } from './services/registry.ts';
|
|
809
802
|
|
|
810
|
-
const isDev = process.env.NODE_ENV !==
|
|
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
|
|
803
|
+
const isDev = process.env.NODE_ENV !== "production";
|
|
815
804
|
|
|
816
805
|
const { app, net } = await createServer({
|
|
817
806
|
config,
|
|
818
807
|
serviceRegistry,
|
|
819
|
-
clientRoot,
|
|
820
808
|
debug: isDev ? { ssr: true } : false,
|
|
821
809
|
});
|
|
822
810
|
|