@umijs/mfsu 4.0.30 → 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.
- package/dist/mfsu/mfsu.d.ts +1 -0
- package/dist/mfsu/mfsu.js +14 -6
- package/package.json +4 -4
package/dist/mfsu/mfsu.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ export declare class MFSU {
|
|
|
52
52
|
getEsbuildLoaderHandler(): any[];
|
|
53
53
|
getCacheFilePath(): string;
|
|
54
54
|
}
|
|
55
|
+
export declare function resolvePublicPath(config: Configuration): string;
|
|
55
56
|
export interface IMFSUStrategy {
|
|
56
57
|
init(webpackConfig: Configuration): void;
|
|
57
58
|
shouldBuild(): string | boolean;
|
package/dist/mfsu/mfsu.js
CHANGED
|
@@ -22,7 +22,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
22
|
// src/mfsu/mfsu.ts
|
|
23
23
|
var mfsu_exports = {};
|
|
24
24
|
__export(mfsu_exports, {
|
|
25
|
-
MFSU: () => MFSU
|
|
25
|
+
MFSU: () => MFSU,
|
|
26
|
+
resolvePublicPath: () => resolvePublicPath
|
|
26
27
|
});
|
|
27
28
|
module.exports = __toCommonJS(mfsu_exports);
|
|
28
29
|
var import_bundler_utils = require("@umijs/bundler-utils");
|
|
@@ -141,10 +142,7 @@ var MFSU = class {
|
|
|
141
142
|
}
|
|
142
143
|
opts.config.entry = entry;
|
|
143
144
|
opts.config.plugins = opts.config.plugins || [];
|
|
144
|
-
let publicPath = opts.config
|
|
145
|
-
if (publicPath === "auto") {
|
|
146
|
-
publicPath = "/";
|
|
147
|
-
}
|
|
145
|
+
let publicPath = resolvePublicPath(opts.config);
|
|
148
146
|
this.publicPath = publicPath;
|
|
149
147
|
opts.config.plugins.push(...[
|
|
150
148
|
new import_webpack_virtual_modules.default(virtualModules),
|
|
@@ -270,7 +268,17 @@ promise new Promise(resolve => {
|
|
|
270
268
|
return this.strategy.getCacheFilePath();
|
|
271
269
|
}
|
|
272
270
|
};
|
|
271
|
+
function resolvePublicPath(config) {
|
|
272
|
+
var _a;
|
|
273
|
+
let publicPath = ((_a = config.output) == null ? void 0 : _a.publicPath) ?? "auto";
|
|
274
|
+
if (publicPath === "auto") {
|
|
275
|
+
publicPath = "/";
|
|
276
|
+
}
|
|
277
|
+
(0, import_assert.default)(typeof publicPath === "string", "Not support function publicPath now");
|
|
278
|
+
return publicPath;
|
|
279
|
+
}
|
|
273
280
|
// Annotate the CommonJS export names for ESM import in node:
|
|
274
281
|
0 && (module.exports = {
|
|
275
|
-
MFSU
|
|
282
|
+
MFSU,
|
|
283
|
+
resolvePublicPath
|
|
276
284
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/mfsu",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.32",
|
|
4
4
|
"description": "@umijs/mfsu",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/mfsu#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"test": "umi-scripts jest-turbo"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@umijs/bundler-esbuild": "4.0.
|
|
27
|
-
"@umijs/bundler-utils": "4.0.
|
|
28
|
-
"@umijs/utils": "4.0.
|
|
26
|
+
"@umijs/bundler-esbuild": "4.0.32",
|
|
27
|
+
"@umijs/bundler-utils": "4.0.32",
|
|
28
|
+
"@umijs/utils": "4.0.32",
|
|
29
29
|
"enhanced-resolve": "5.9.3",
|
|
30
30
|
"is-equal": "^1.6.4"
|
|
31
31
|
},
|