@wzyjs/cli 0.2.10 → 0.2.12
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) => {
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -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,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wzyjs/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "description",
|
|
5
5
|
"author": "wzy",
|
|
6
|
-
"license": "ISC",
|
|
7
6
|
"scripts": {
|
|
8
7
|
"dev": "tsc -w",
|
|
9
8
|
"build": "tsc --noEmitOnError false",
|
|
@@ -22,6 +21,7 @@
|
|
|
22
21
|
"@midwayjs/command-core": "^1.3.14",
|
|
23
22
|
"@midwayjs/core": "^3.12.3",
|
|
24
23
|
"@midwayjs/hooks-internal": "^3.1.6",
|
|
24
|
+
"@midwayjs/logger": "^3.4.2",
|
|
25
25
|
"@midwayjs/rpc": "^3.1.6",
|
|
26
26
|
"@umijs/plugins": "^4.0.28",
|
|
27
27
|
"cac": "^6.7.14",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"type": "git",
|
|
45
45
|
"url": "https://gitee.com/wang-zhenyu/app.git"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "41c740c5efe9cef6e892af9dfb8c1bd3ffaa6239"
|
|
48
48
|
}
|