@umijs/preset-umi 4.0.33 → 4.0.34
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/commands/config/set.d.ts +1 -1
- package/dist/commands/generators/precommit.js +6 -2
- package/dist/features/apiRoute/request.d.ts +1 -0
- package/dist/features/codeSplitting/codeSplitting.js +7 -3
- package/dist/features/polyfill/polyfill.js +3 -1
- package/dist/libs/folderCache/LazySourceCodeCache.js +2 -1
- package/dist/libs/folderCache/empty.tsconfig.json +1 -0
- package/package.json +12 -12
- package/templates/umi.tpl +1 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IApi } from '../../types';
|
|
2
|
-
export declare function set(api: IApi, name: string, value:
|
|
2
|
+
export declare function set(api: IApi, name: string, value: string): void;
|
|
@@ -80,7 +80,9 @@ var precommit_default = (api) => {
|
|
|
80
80
|
npx --no-install ${cliName} verify-commit $1
|
|
81
81
|
`.trimStart());
|
|
82
82
|
import_utils.logger.info("Write commit-msg");
|
|
83
|
-
|
|
83
|
+
if (process.platform !== "win32") {
|
|
84
|
+
import_utils.execa.execaCommandSync("chmod +x .husky/commit-msg");
|
|
85
|
+
}
|
|
84
86
|
}
|
|
85
87
|
if (!(0, import_fs.existsSync)((0, import_path.join)(api.cwd, ".husky/pre-commit"))) {
|
|
86
88
|
(0, import_fs.writeFileSync)((0, import_path.join)(api.cwd, ".husky/pre-commit"), `
|
|
@@ -90,7 +92,9 @@ npx --no-install ${cliName} verify-commit $1
|
|
|
90
92
|
npx --no-install lint-staged --quiet
|
|
91
93
|
`.trimStart());
|
|
92
94
|
import_utils.logger.info("Write pre-commit");
|
|
93
|
-
|
|
95
|
+
if (process.platform !== "win32") {
|
|
96
|
+
import_utils.execa.execaCommandSync("chmod +x .husky/pre-commit");
|
|
97
|
+
}
|
|
94
98
|
}
|
|
95
99
|
h.installDeps();
|
|
96
100
|
}
|
|
@@ -99,12 +99,13 @@ var codeSplitting_default = (api) => {
|
|
|
99
99
|
},
|
|
100
100
|
lib: {
|
|
101
101
|
test(module2) {
|
|
102
|
-
return module2.size() > 16e4 && /node_modules[/\\]/.test(module2.identifier());
|
|
102
|
+
return !isModuleCSS(module2) && module2.size() > 16e4 && /node_modules[/\\]/.test(module2.identifier());
|
|
103
103
|
},
|
|
104
104
|
name(module2) {
|
|
105
105
|
const rawRequest = module2.rawRequest && module2.rawRequest.replace(/^@(\w+)[/\\]/, "$1-");
|
|
106
|
-
if (rawRequest)
|
|
107
|
-
return `${rawRequest}-lib`;
|
|
106
|
+
if (rawRequest) {
|
|
107
|
+
return `${rawRequest.replace(/\./g, "_").replace(/\//g, "-")}-lib`;
|
|
108
|
+
}
|
|
108
109
|
const identifier = module2.identifier();
|
|
109
110
|
const trimmedIdentifier = /(?:^|[/\\])node_modules[/\\](.*)/.exec(identifier);
|
|
110
111
|
const processedIdentifier = trimmedIdentifier && trimmedIdentifier[1].replace(/^@(\w+)[/\\]/, "$1-");
|
|
@@ -136,5 +137,8 @@ var codeSplitting_default = (api) => {
|
|
|
136
137
|
return memo;
|
|
137
138
|
});
|
|
138
139
|
};
|
|
140
|
+
function isModuleCSS(module2) {
|
|
141
|
+
return module2.type === `css/mini-extract` || module2.type === `css/extract-chunks` || module2.type === `css/extract-css-chunks`;
|
|
142
|
+
}
|
|
139
143
|
// Annotate the CommonJS export names for ESM import in node:
|
|
140
144
|
0 && (module.exports = {});
|
|
@@ -163,7 +163,8 @@ async function esbuildTransform(files, opts) {
|
|
|
163
163
|
".js": "tsx",
|
|
164
164
|
".jsx": "tsx"
|
|
165
165
|
},
|
|
166
|
-
logLevel: "error"
|
|
166
|
+
logLevel: "error",
|
|
167
|
+
tsconfig: (0, import_path.join)(__dirname, "empty.tsconfig.json")
|
|
167
168
|
});
|
|
168
169
|
} catch (e) {
|
|
169
170
|
if (((_a = e.errors) == null ? void 0 : _a.length) || ((_b = e.warnings) == null ? void 0 : _b.length)) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/preset-umi",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.34",
|
|
4
4
|
"description": "@umijs/preset-umi",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/preset-umi#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"test": "umi-scripts jest-turbo"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@umijs/ast": "4.0.
|
|
29
|
-
"@umijs/babel-preset-umi": "4.0.
|
|
30
|
-
"@umijs/bundler-utils": "4.0.
|
|
31
|
-
"@umijs/bundler-vite": "4.0.
|
|
32
|
-
"@umijs/bundler-webpack": "4.0.
|
|
33
|
-
"@umijs/core": "4.0.
|
|
28
|
+
"@umijs/ast": "4.0.34",
|
|
29
|
+
"@umijs/babel-preset-umi": "4.0.34",
|
|
30
|
+
"@umijs/bundler-utils": "4.0.34",
|
|
31
|
+
"@umijs/bundler-vite": "4.0.34",
|
|
32
|
+
"@umijs/bundler-webpack": "4.0.34",
|
|
33
|
+
"@umijs/core": "4.0.34",
|
|
34
34
|
"@umijs/did-you-know": "^1.0.0",
|
|
35
35
|
"@umijs/history": "5.3.1",
|
|
36
|
-
"@umijs/mfsu": "4.0.
|
|
37
|
-
"@umijs/plugin-run": "4.0.
|
|
38
|
-
"@umijs/renderer-react": "4.0.
|
|
39
|
-
"@umijs/server": "4.0.
|
|
40
|
-
"@umijs/utils": "4.0.
|
|
36
|
+
"@umijs/mfsu": "4.0.34",
|
|
37
|
+
"@umijs/plugin-run": "4.0.34",
|
|
38
|
+
"@umijs/renderer-react": "4.0.34",
|
|
39
|
+
"@umijs/server": "4.0.34",
|
|
40
|
+
"@umijs/utils": "4.0.34",
|
|
41
41
|
"babel-plugin-dynamic-import-node": "2.3.3",
|
|
42
42
|
"click-to-react-component": "^1.0.8",
|
|
43
43
|
"core-js": "3.22.4",
|