@wzyjs/cli 0.2.9 → 0.2.11

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.
@@ -43,7 +43,7 @@ exports.default = (cli) => {
43
43
  console.info('正在清理之前的 build 产物...');
44
44
  await fs.promises.rm(outDir, { recursive: true });
45
45
  }
46
- (0, utils_1.hack)();
46
+ await (0, utils_1.hack)();
47
47
  // 合并用户配置
48
48
  const productionConfig = (0, utils_1.getProductionConfig)(root);
49
49
  console.info('正在打包前端代码...');
@@ -7,13 +7,13 @@ exports.default = (cli) => {
7
7
  .option('--port [port]', `port (default: 7001)`, {
8
8
  default: '7001',
9
9
  })
10
- .action(options => {
10
+ .action(async (options) => {
11
11
  const { port } = options;
12
12
  // 设置 midway 接口服务端口为指定端口
13
13
  process.env.MIDWAY_HTTP_PORT = port;
14
14
  // 增加 nodeJs 运行时内存的大小
15
15
  process.env.NODE_OPTIONS = '--max-old-space-size=10240';
16
- (0, utils_1.hack)();
16
+ await (0, utils_1.hack)();
17
17
  (0, umi_1.run)({
18
18
  presets: [require.resolve('../../plugins/preset')],
19
19
  }).catch((e) => {
@@ -8,4 +8,4 @@ export declare const executePromise: (promise: Promise<any>) => Promise<{
8
8
  result: any;
9
9
  time: number;
10
10
  }>;
11
- export declare const hack: () => void;
11
+ export declare const hack: () => Promise<void>;
@@ -118,11 +118,11 @@ const replaceContentInFile = (filePath, targetContent, replacement) => {
118
118
  });
119
119
  });
120
120
  };
121
- const hack = () => {
121
+ const hack = async () => {
122
122
  const pwd = path_1.default.resolve(__dirname, '../../');
123
- replaceContentInFile(`${pwd}/node_modules/@umijs/preset-umi/dist/libs/scan.js`, 'exportsFields: []', `exportsFields: ['exports'],
123
+ await replaceContentInFile(`${pwd}/node_modules/@umijs/preset-umi/dist/libs/scan.js`, 'exportsFields: []', `exportsFields: ['exports'],
124
124
  conditionNames: ["import", "require"]`);
125
- replaceContentInFile(`${pwd}/node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js`, 'paths = fieldProcessor(remainingRequest, this.conditionNames);', `paths = fieldProcessor(remainingRequest, this.conditionNames)
125
+ await replaceContentInFile(`${pwd}/node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js`, 'paths = fieldProcessor(remainingRequest, this.conditionNames);', `paths = fieldProcessor(remainingRequest, this.conditionNames)
126
126
  if (paths.length === 0 && remainingRequest === '.' && request.descriptionFileData.name === 'typeorm') {
127
127
  paths = ['./index.mjs']
128
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wzyjs/cli",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "description",
5
5
  "author": "wzy",
6
6
  "license": "ISC",
@@ -22,7 +22,6 @@
22
22
  "@midwayjs/command-core": "^1.3.14",
23
23
  "@midwayjs/core": "^3.12.3",
24
24
  "@midwayjs/hooks-internal": "^3.1.6",
25
- "@midwayjs/logger": "^3.4.2",
26
25
  "@midwayjs/rpc": "^3.1.6",
27
26
  "@umijs/plugins": "^4.0.28",
28
27
  "cac": "^6.7.14",
@@ -45,5 +44,5 @@
45
44
  "type": "git",
46
45
  "url": "https://gitee.com/wang-zhenyu/app.git"
47
46
  },
48
- "gitHead": "24d7d21aecb4236ea4fdfea572069e449e7676d6"
47
+ "gitHead": "9d97c2cbb966eae7481264c06522f9f9b6a75777"
49
48
  }