@taujs/create-taujs 0.1.2 → 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 +6 -11
- 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
|
}
|
|
@@ -806,11 +800,12 @@ function generateServerIndex() {
|
|
|
806
800
|
import config from '../../taujs.config.ts';
|
|
807
801
|
import { serviceRegistry } from './services/registry.ts';
|
|
808
802
|
|
|
803
|
+
const isDev = process.env.NODE_ENV !== "production";
|
|
804
|
+
|
|
809
805
|
const { app, net } = await createServer({
|
|
810
806
|
config,
|
|
811
807
|
serviceRegistry,
|
|
812
|
-
|
|
813
|
-
debug: !!process.env.DEBUG,
|
|
808
|
+
debug: isDev ? { ssr: true } : false,
|
|
814
809
|
});
|
|
815
810
|
|
|
816
811
|
if (app) {
|