@umijs/preset-umi 4.1.0 → 4.1.2
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/build.js
CHANGED
|
@@ -48,9 +48,8 @@ COMPRESS=none umi build
|
|
|
48
48
|
umi build --clean
|
|
49
49
|
`,
|
|
50
50
|
fn: async function() {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
);
|
|
51
|
+
var _a;
|
|
52
|
+
import_utils.logger.info(import_utils.chalk.cyan.bold(`Umi v${api.appData.umi.version}`));
|
|
54
53
|
import_utils.rimraf.sync(api.paths.absTmpPath);
|
|
55
54
|
await api.applyPlugins({
|
|
56
55
|
key: "onCheckPkgJSON",
|
|
@@ -106,7 +105,11 @@ umi build --clean
|
|
|
106
105
|
umi: (0, import_path.join)(api.paths.absTmpPath, "umi.ts")
|
|
107
106
|
}
|
|
108
107
|
});
|
|
108
|
+
const isGTEReact17 = ((_a = api.appData.react) == null ? void 0 : _a.version) && import_utils.semver.gte(api.appData.react.version, "17.0.0");
|
|
109
109
|
const opts = {
|
|
110
|
+
react: {
|
|
111
|
+
runtime: isGTEReact17 ? "automatic" : "classic"
|
|
112
|
+
},
|
|
110
113
|
config: api.config,
|
|
111
114
|
cwd: api.cwd,
|
|
112
115
|
entry,
|
package/dist/commands/dev/dev.js
CHANGED
|
@@ -70,10 +70,8 @@ umi dev
|
|
|
70
70
|
PORT=8888 umi dev
|
|
71
71
|
`,
|
|
72
72
|
async fn() {
|
|
73
|
-
var _a, _b, _c, _d, _e;
|
|
74
|
-
import_utils.logger.info(
|
|
75
|
-
import_utils.chalk.cyan.bold(`${api.appData.umi.name} v${api.appData.umi.version}`)
|
|
76
|
-
);
|
|
73
|
+
var _a, _b, _c, _d, _e, _f;
|
|
74
|
+
import_utils.logger.info(import_utils.chalk.cyan.bold(`Umi v${api.appData.umi.version}`));
|
|
77
75
|
const enableVite = !!api.config.vite;
|
|
78
76
|
import_utils.rimraf.sync(api.paths.absTmpPath);
|
|
79
77
|
await api.applyPlugins({
|
|
@@ -311,7 +309,11 @@ PORT=8888 umi dev
|
|
|
311
309
|
umi: (0, import_path.join)(api.paths.absTmpPath, "umi.ts")
|
|
312
310
|
}
|
|
313
311
|
});
|
|
312
|
+
const isGTEReact17 = ((_c = api.appData.react) == null ? void 0 : _c.version) && import_utils.semver.gte(api.appData.react.version, "17.0.0");
|
|
314
313
|
const opts = {
|
|
314
|
+
react: {
|
|
315
|
+
runtime: isGTEReact17 ? "automatic" : "classic"
|
|
316
|
+
},
|
|
315
317
|
config: api.config,
|
|
316
318
|
pkg: api.pkg,
|
|
317
319
|
cwd: api.cwd,
|
|
@@ -352,8 +354,8 @@ PORT=8888 umi dev
|
|
|
352
354
|
...opts2
|
|
353
355
|
};
|
|
354
356
|
},
|
|
355
|
-
mfsuWithESBuild: (
|
|
356
|
-
mfsuStrategy: (
|
|
357
|
+
mfsuWithESBuild: (_d = api.config.mfsu) == null ? void 0 : _d.esbuild,
|
|
358
|
+
mfsuStrategy: (_e = api.config.mfsu) == null ? void 0 : _e.strategy,
|
|
357
359
|
cache: {
|
|
358
360
|
buildDependencies: [
|
|
359
361
|
api.pkgPath,
|
|
@@ -363,7 +365,7 @@ PORT=8888 umi dev
|
|
|
363
365
|
srcCodeCache,
|
|
364
366
|
mfsuInclude: import_utils.lodash.union([
|
|
365
367
|
...MFSU_EAGER_DEFAULT_INCLUDE,
|
|
366
|
-
...((
|
|
368
|
+
...((_f = api.config.mfsu) == null ? void 0 : _f.include) || []
|
|
367
369
|
]),
|
|
368
370
|
startBuildWorker,
|
|
369
371
|
onBeforeMiddleware(app) {
|
|
@@ -52,9 +52,7 @@ var MFSUUtilBase = class {
|
|
|
52
52
|
async prepare() {
|
|
53
53
|
var _a, _b, _c, _d;
|
|
54
54
|
const api = this.api;
|
|
55
|
-
import_utils.logger.info(
|
|
56
|
-
import_utils.chalk.cyan.bold(`${api.appData.umi.name} v${api.appData.umi.version}`)
|
|
57
|
-
);
|
|
55
|
+
import_utils.logger.info(import_utils.chalk.cyan.bold(`Umi v${api.appData.umi.version}`));
|
|
58
56
|
import_utils.rimraf.sync(api.paths.absTmpPath);
|
|
59
57
|
const generate = async (opts2) => {
|
|
60
58
|
await api.applyPlugins({
|
|
@@ -175,7 +175,11 @@ var exportStatic_default = (api) => {
|
|
|
175
175
|
markupArgs = Object.assign({}, markupArgs, picked);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
const htmlContent = await (0, import_server.getMarkup)(
|
|
178
|
+
const htmlContent = await (0, import_server.getMarkup)({
|
|
179
|
+
...markupArgs,
|
|
180
|
+
// https://github.com/umijs/umi/issues/12108
|
|
181
|
+
path: route.path
|
|
182
|
+
});
|
|
179
183
|
htmlFiles.push({
|
|
180
184
|
path: file,
|
|
181
185
|
content: api.config.ssr && prerender ? await getPreRenderedHTML(api, htmlContent, route.path) : htmlContent
|
|
@@ -70,6 +70,8 @@ async function transform(cssContent, filePath) {
|
|
|
70
70
|
return `html:first-child`;
|
|
71
71
|
} else if (/^body([\s+~>[:]|$)/.test(selector)) {
|
|
72
72
|
return `html ${selector}`;
|
|
73
|
+
} else if (selector === ":root") {
|
|
74
|
+
return "html:root";
|
|
73
75
|
}
|
|
74
76
|
return prefixedSelector;
|
|
75
77
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/preset-umi",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
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",
|
|
@@ -39,21 +39,21 @@
|
|
|
39
39
|
"react-router": "6.3.0",
|
|
40
40
|
"react-router-dom": "6.3.0",
|
|
41
41
|
"regenerator-runtime": "0.13.11",
|
|
42
|
-
"@umijs/
|
|
43
|
-
"@umijs/
|
|
44
|
-
"@umijs/bundler-utils": "4.1.
|
|
45
|
-
"@umijs/bundler-
|
|
46
|
-
"@umijs/
|
|
47
|
-
"@umijs/
|
|
48
|
-
"@umijs/mfsu": "4.1.
|
|
49
|
-
"@umijs/plugin-run": "4.1.0",
|
|
50
|
-
"@umijs/bundler-webpack": "4.1.0",
|
|
51
|
-
"@umijs/renderer-react": "4.1.0",
|
|
52
|
-
"@umijs/server": "4.1.0",
|
|
53
|
-
"@umijs/utils": "4.1.0",
|
|
54
|
-
"@umijs/ui": "3.0.1",
|
|
42
|
+
"@umijs/babel-preset-umi": "4.1.2",
|
|
43
|
+
"@umijs/bundler-esbuild": "4.1.2",
|
|
44
|
+
"@umijs/bundler-utils": "4.1.2",
|
|
45
|
+
"@umijs/bundler-vite": "4.1.2",
|
|
46
|
+
"@umijs/core": "4.1.2",
|
|
47
|
+
"@umijs/bundler-webpack": "4.1.2",
|
|
48
|
+
"@umijs/mfsu": "4.1.2",
|
|
55
49
|
"@umijs/did-you-know": "1.0.3",
|
|
56
|
-
"@umijs/
|
|
50
|
+
"@umijs/plugin-run": "4.1.2",
|
|
51
|
+
"@umijs/ast": "4.1.2",
|
|
52
|
+
"@umijs/renderer-react": "4.1.2",
|
|
53
|
+
"@umijs/server": "4.1.2",
|
|
54
|
+
"@umijs/ui": "3.0.1",
|
|
55
|
+
"@umijs/utils": "4.1.2",
|
|
56
|
+
"@umijs/zod2ts": "4.1.2"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@manypkg/get-packages": "1.1.3",
|