@lark-apaas/fullstack-cli 1.1.16-beta.0 → 1.1.16-beta.10

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.
@@ -6,11 +6,12 @@ const fs = require('fs');
6
6
  const path = require('path');
7
7
 
8
8
  const ROOT_DIR = path.resolve(__dirname, '..');
9
- const DIST_SERVER_DIR = path.join(ROOT_DIR, 'dist/server');
9
+ const DIST_DIR = path.join(ROOT_DIR, 'dist');
10
+ const DIST_SERVER_DIR = path.join(DIST_DIR, 'server');
10
11
  const ROOT_PACKAGE_JSON = path.join(ROOT_DIR, 'package.json');
11
12
  const ROOT_NODE_MODULES = path.join(ROOT_DIR, 'node_modules');
12
- const OUT_NODE_MODULES = path.join(ROOT_DIR, 'dist/node_modules');
13
- const OUT_PACKAGE_JSON = path.join(DIST_SERVER_DIR, 'package.json');
13
+ const OUT_NODE_MODULES = path.join(DIST_DIR, 'node_modules');
14
+ const OUT_PACKAGE_JSON = path.join(DIST_DIR, 'package.json');
14
15
 
15
16
  // Server 入口文件
16
17
  const SERVER_ENTRY = path.join(DIST_SERVER_DIR, 'main.js');
@@ -294,9 +295,6 @@ async function smartPrune() {
294
295
  version: originalPackage.version,
295
296
  private: true,
296
297
  dependencies: prunedDependencies,
297
- scripts: {
298
- start: originalPackage.scripts?.start || 'node main.js'
299
- },
300
298
  engines: originalPackage.engines
301
299
  };
302
300
 
@@ -2,4 +2,7 @@
2
2
  # This file is auto-generated by @lark-apaas/fullstack-cli
3
3
 
4
4
  # 生产环境下,启动服务
5
- npm run start
5
+ # dist/ 根目录执行,确保 process.cwd() 与 dev 模式一致
6
+ # dev: cwd = 项目根, shared/ client/ 可达
7
+ # prod: cwd = dist/, shared/ client/ 可达
8
+ NODE_ENV=production node server/main.js