@umijs/preset-umi 4.0.72 → 4.0.74

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.
@@ -119,6 +119,13 @@ var exportStatic_default = (api) => {
119
119
  const htmlFiles = [];
120
120
  for (const { file, route, prerender } of htmlData) {
121
121
  let { markupArgs } = opts;
122
+ if (api.config.ssr && prerender) {
123
+ markupArgs.scripts.forEach((script) => {
124
+ if (script.src) {
125
+ script.async = true;
126
+ }
127
+ });
128
+ }
122
129
  if (publicPath.startsWith(".")) {
123
130
  (0, import_assert.default)(
124
131
  api.config.runtimePublicPath,
@@ -564,10 +564,16 @@ if (process.env.NODE_ENV === 'development') {
564
564
  exports.push(`export { TestBrowser } from './testBrowser';`);
565
565
  }
566
566
  }
567
- if (api.config.ssr && api.appData.framework === "react") {
568
- exports.push(
569
- `export { useServerInsertedHTML } from './core/serverInsertedHTMLContext';`
570
- );
567
+ if (api.appData.framework === "react") {
568
+ if (api.config.ssr) {
569
+ exports.push(
570
+ `export { useServerInsertedHTML } from './core/serverInsertedHTMLContext';`
571
+ );
572
+ } else {
573
+ exports.push(
574
+ `export const useServerInsertedHTML: Function = () => {};`
575
+ );
576
+ }
571
577
  }
572
578
  exports.push("// plugins");
573
579
  const allPlugins = (0, import_fs.readdirSync)(api.paths.absTmpPath).filter(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/preset-umi",
3
- "version": "4.0.72",
3
+ "version": "4.0.74",
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",
@@ -37,21 +37,21 @@
37
37
  "react-router": "6.3.0",
38
38
  "react-router-dom": "6.3.0",
39
39
  "regenerator-runtime": "0.13.11",
40
- "@umijs/ast": "4.0.72",
41
- "@umijs/babel-preset-umi": "4.0.72",
42
- "@umijs/bundler-utils": "4.0.72",
43
- "@umijs/bundler-esbuild": "4.0.72",
44
- "@umijs/bundler-webpack": "4.0.72",
45
- "@umijs/core": "4.0.72",
46
- "@umijs/bundler-vite": "4.0.72",
47
- "@umijs/mfsu": "4.0.72",
40
+ "@umijs/ast": "4.0.74",
41
+ "@umijs/bundler-esbuild": "4.0.74",
42
+ "@umijs/babel-preset-umi": "4.0.74",
43
+ "@umijs/bundler-webpack": "4.0.74",
44
+ "@umijs/bundler-utils": "4.0.74",
45
+ "@umijs/core": "4.0.74",
46
+ "@umijs/bundler-vite": "4.0.74",
48
47
  "@umijs/did-you-know": "1.0.3",
49
- "@umijs/server": "4.0.72",
50
- "@umijs/renderer-react": "4.0.72",
51
- "@umijs/plugin-run": "4.0.72",
52
- "@umijs/utils": "4.0.72",
48
+ "@umijs/plugin-run": "4.0.74",
49
+ "@umijs/mfsu": "4.0.74",
50
+ "@umijs/server": "4.0.74",
53
51
  "@umijs/ui": "3.0.1",
54
- "@umijs/zod2ts": "4.0.72"
52
+ "@umijs/renderer-react": "4.0.74",
53
+ "@umijs/zod2ts": "4.0.74",
54
+ "@umijs/utils": "4.0.74"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@manypkg/get-packages": "1.1.3",