@umijs/preset-umi 4.0.31 → 4.0.32

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.
@@ -1,5 +1,4 @@
1
1
  /// <reference types="node" />
2
- /// <reference types="node" />
3
2
  import type { IncomingMessage } from 'http';
4
3
  import type { IRoute } from '../../types';
5
4
  declare class UmiApiRequest {
@@ -67,7 +67,10 @@ var codeSplitting_default = (api) => {
67
67
  chunks: "async",
68
68
  name(module2) {
69
69
  const path = module2.context.replace(/.pnpm[\\/]/, "");
70
- const packageName = path.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
70
+ const match = path.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/);
71
+ if (!match)
72
+ return "npm.unknown";
73
+ const packageName = match[1];
71
74
  return `npm.${packageName.replace(/@/g, "_at_").replace(/\+/g, "_")}`;
72
75
  }
73
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/preset-umi",
3
- "version": "4.0.31",
3
+ "version": "4.0.32",
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.31",
29
- "@umijs/babel-preset-umi": "4.0.31",
30
- "@umijs/bundler-utils": "4.0.31",
31
- "@umijs/bundler-vite": "4.0.31",
32
- "@umijs/bundler-webpack": "4.0.31",
33
- "@umijs/core": "4.0.31",
28
+ "@umijs/ast": "4.0.32",
29
+ "@umijs/babel-preset-umi": "4.0.32",
30
+ "@umijs/bundler-utils": "4.0.32",
31
+ "@umijs/bundler-vite": "4.0.32",
32
+ "@umijs/bundler-webpack": "4.0.32",
33
+ "@umijs/core": "4.0.32",
34
34
  "@umijs/did-you-know": "^1.0.0",
35
35
  "@umijs/history": "5.3.1",
36
- "@umijs/mfsu": "4.0.31",
37
- "@umijs/plugin-run": "4.0.31",
38
- "@umijs/renderer-react": "4.0.31",
39
- "@umijs/server": "4.0.31",
40
- "@umijs/utils": "4.0.31",
36
+ "@umijs/mfsu": "4.0.32",
37
+ "@umijs/plugin-run": "4.0.32",
38
+ "@umijs/renderer-react": "4.0.32",
39
+ "@umijs/server": "4.0.32",
40
+ "@umijs/utils": "4.0.32",
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",
package/templates/umi.tpl CHANGED
@@ -27,25 +27,16 @@ async function render() {
27
27
  },
28
28
  });
29
29
 
30
- const contextOpts = pluginManager.applyPlugins({
31
- key: 'modifyContextOpts',
32
- type: ApplyPluginsType.modify,
33
- initialValue: {},
34
- });
35
-
36
- const basename = contextOpts.basename || '{{{ basename }}}';
37
-
38
- const history = createHistory({
39
- type: contextOpts.historyType || '{{{ historyType }}}',
40
- basename,
41
- ...contextOpts.historyOpts,
42
- });
43
-
44
30
  return (pluginManager.applyPlugins({
45
31
  key: 'render',
46
32
  type: ApplyPluginsType.compose,
47
33
  initialValue() {
48
-
34
+ const contextOpts = pluginManager.applyPlugins({
35
+ key: 'modifyContextOpts',
36
+ type: ApplyPluginsType.modify,
37
+ initialValue: {},
38
+ });
39
+ const basename = contextOpts.basename || '{{{ basename }}}';
49
40
  const context = {
50
41
  {{#hydrate}}
51
42
  hydrate: true,
@@ -62,7 +53,11 @@ async function render() {
62
53
  {{/loadingComponent}}
63
54
  publicPath,
64
55
  runtimePublicPath,
65
- history,
56
+ history: createHistory({
57
+ type: contextOpts.historyType || '{{{ historyType }}}',
58
+ basename,
59
+ ...contextOpts.historyOpts,
60
+ }),
66
61
  basename,
67
62
  };
68
63
  return renderClient(context);