@umijs/preset-umi 4.0.55 → 4.0.56
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.
|
@@ -166,9 +166,10 @@ var appData_default = (api) => {
|
|
|
166
166
|
existsAndPushFile,
|
|
167
167
|
[]
|
|
168
168
|
);
|
|
169
|
-
const
|
|
169
|
+
const loadingFile = (0, import_watch.expandJSPaths)((0, import_path.join)(absSrcPath, "loading")).find(
|
|
170
170
|
import_fs.existsSync
|
|
171
171
|
);
|
|
172
|
+
const globalLoading = loadingFile ? (0, import_utils.winPath)(loadingFile) : void 0;
|
|
172
173
|
const overridesCSS = [(0, import_overrides.getOverridesCSS)(api.paths.absSrcPath)].filter(
|
|
173
174
|
Boolean
|
|
174
175
|
);
|
|
@@ -49,11 +49,17 @@ var helmet_default = (api) => {
|
|
|
49
49
|
import { HelmetProvider } from '${(0, import_utils.winPath)(
|
|
50
50
|
(0, import_path.dirname)(require.resolve("@umijs/renderer-react/package"))
|
|
51
51
|
)}';
|
|
52
|
+
import { context } from './helmetContext';
|
|
52
53
|
|
|
53
54
|
export const innerProvider = (container) => {
|
|
54
|
-
return React.createElement(HelmetProvider, { context
|
|
55
|
+
return React.createElement(HelmetProvider, { context }, container);
|
|
55
56
|
}`
|
|
56
57
|
});
|
|
58
|
+
api.writeTmpFile({
|
|
59
|
+
noPluginDir: true,
|
|
60
|
+
path: "core/helmetContext.ts",
|
|
61
|
+
content: `export const context = {};`
|
|
62
|
+
});
|
|
57
63
|
}
|
|
58
64
|
});
|
|
59
65
|
api.addRuntimePlugin(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/preset-umi",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.56",
|
|
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",
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@iconify/utils": "2.1.1",
|
|
29
29
|
"@svgr/core": "6.5.1",
|
|
30
|
-
"@umijs/ast": "4.0.
|
|
31
|
-
"@umijs/babel-preset-umi": "4.0.
|
|
32
|
-
"@umijs/bundler-utils": "4.0.
|
|
33
|
-
"@umijs/bundler-vite": "4.0.
|
|
34
|
-
"@umijs/bundler-webpack": "4.0.
|
|
35
|
-
"@umijs/core": "4.0.
|
|
30
|
+
"@umijs/ast": "4.0.56",
|
|
31
|
+
"@umijs/babel-preset-umi": "4.0.56",
|
|
32
|
+
"@umijs/bundler-utils": "4.0.56",
|
|
33
|
+
"@umijs/bundler-vite": "4.0.56",
|
|
34
|
+
"@umijs/bundler-webpack": "4.0.56",
|
|
35
|
+
"@umijs/core": "4.0.56",
|
|
36
36
|
"@umijs/did-you-know": "^1.0.0",
|
|
37
37
|
"@umijs/history": "5.3.1",
|
|
38
|
-
"@umijs/mfsu": "4.0.
|
|
39
|
-
"@umijs/plugin-run": "4.0.
|
|
40
|
-
"@umijs/renderer-react": "4.0.
|
|
41
|
-
"@umijs/server": "4.0.
|
|
42
|
-
"@umijs/utils": "4.0.
|
|
38
|
+
"@umijs/mfsu": "4.0.56",
|
|
39
|
+
"@umijs/plugin-run": "4.0.56",
|
|
40
|
+
"@umijs/renderer-react": "4.0.56",
|
|
41
|
+
"@umijs/server": "4.0.56",
|
|
42
|
+
"@umijs/utils": "4.0.56",
|
|
43
43
|
"babel-plugin-dynamic-import-node": "2.3.3",
|
|
44
44
|
"click-to-react-component": "^1.0.8",
|
|
45
45
|
"core-js": "3.28.0",
|
package/templates/server.tpl
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { getClientRootComponent
|
|
1
|
+
import { getClientRootComponent } from '{{{ serverRendererPath }}}';
|
|
2
2
|
import { getRoutes } from './core/route';
|
|
3
3
|
import { createHistory as createClientHistory } from './core/history';
|
|
4
4
|
import { getPlugins as getClientPlugins } from './core/plugin';
|
|
5
5
|
import { PluginManager } from '{{{ umiPluginPath }}}';
|
|
6
6
|
import createRequestHandler, { createMarkupGenerator } from '{{{ umiServerPath }}}';
|
|
7
7
|
|
|
8
|
+
let helmetContext;
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
helmetContext = require('./core/helmetContext').context;
|
|
12
|
+
} catch { /* means `helmet: false`, do noting */ }
|
|
13
|
+
|
|
8
14
|
const routesWithServerLoader = {
|
|
9
15
|
{{#routesWithServerLoader}}
|
|
10
16
|
'{{{ id }}}': () => import('{{{ path }}}'),
|
|
@@ -42,7 +48,7 @@ const createOpts = {
|
|
|
42
48
|
getRoutes,
|
|
43
49
|
manifest,
|
|
44
50
|
getClientRootComponent,
|
|
45
|
-
helmetContext
|
|
51
|
+
helmetContext,
|
|
46
52
|
createHistory,
|
|
47
53
|
};
|
|
48
54
|
const requestHandler = createRequestHandler(createOpts);
|