@umijs/mfsu 4.0.7 → 4.0.10
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/compiled/is-absolute-url/LICENSE +9 -0
- package/compiled/is-absolute-url/index.d.ts +22 -0
- package/compiled/is-absolute-url/index.js +1 -0
- package/compiled/is-absolute-url/package.json +1 -0
- package/dist/babelPlugins/awaitImport/MFImport.js +59 -66
- package/dist/babelPlugins/awaitImport/awaitImport.d.ts +1 -1
- package/dist/babelPlugins/awaitImport/awaitImport.js +103 -117
- package/dist/babelPlugins/awaitImport/checkMatch.js +131 -119
- package/dist/babelPlugins/awaitImport/getAliasedPath.js +54 -35
- package/dist/babelPlugins/awaitImport/getRealPath.js +42 -21
- package/dist/babelPlugins/awaitImport/isExternals.js +55 -26
- package/dist/babelPlugins/awaitImport/parseSpecifiers.js +51 -52
- package/dist/constants.js +47 -10
- package/dist/dep/dep.js +112 -83
- package/dist/dep/getCJSExports.js +60 -53
- package/dist/dep/getExposeFromContent.js +71 -59
- package/dist/dep/getModuleExports.js +58 -32
- package/dist/depBuilder/depBuilder.js +191 -158
- package/dist/depBuilder/getESBuildEntry.js +35 -12
- package/dist/depInfo.js +75 -53
- package/dist/esbuildHandlers/autoCssModules.js +43 -22
- package/dist/esbuildHandlers/awaitImport/index.js +82 -70
- package/dist/index.js +32 -22
- package/dist/loader/esbuild.js +87 -35
- package/dist/mfsu/mfsu.d.ts +5 -1
- package/dist/mfsu/mfsu.js +236 -257
- package/dist/mfsu/strategyCompileTime.js +131 -99
- package/dist/mfsu/strategyStaticAnalyze.js +151 -115
- package/dist/moduleGraph.js +227 -186
- package/dist/staticDepInfo/importParser.js +28 -6
- package/dist/staticDepInfo/simulations/babel-plugin-import.js +99 -91
- package/dist/staticDepInfo/staticDepInfo.js +239 -197
- package/dist/types.js +33 -8
- package/dist/utils/makeArray.js +29 -5
- package/dist/utils/trimFileContent.js +29 -5
- package/dist/webpackPlugins/buildDepPlugin.js +49 -25
- package/dist/webpackPlugins/depChunkIdPrefixPlugin.js +44 -19
- package/dist/webpackPlugins/stripSourceMapUrlPlugin.js +46 -27
- package/dist/webpackPlugins/writeCachePlugin.js +39 -15
- package/package.json +8 -6
|
@@ -1,19 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/webpackPlugins/depChunkIdPrefixPlugin.ts
|
|
20
|
+
var depChunkIdPrefixPlugin_exports = {};
|
|
21
|
+
__export(depChunkIdPrefixPlugin_exports, {
|
|
22
|
+
DepChunkIdPrefixPlugin: () => DepChunkIdPrefixPlugin
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(depChunkIdPrefixPlugin_exports);
|
|
25
|
+
var import_constants = require("../constants");
|
|
26
|
+
var pluginId = "MFSUDepChunkIdPrefix";
|
|
27
|
+
var DepChunkIdPrefixPlugin = class {
|
|
28
|
+
constructor() {
|
|
29
|
+
}
|
|
30
|
+
apply(compiler) {
|
|
31
|
+
compiler.hooks.compilation.tap(pluginId, (compilation) => {
|
|
32
|
+
compilation.hooks.afterOptimizeChunkIds.tap(pluginId, (chunks) => {
|
|
33
|
+
for (const chunk of chunks) {
|
|
34
|
+
chunk.id = import_constants.MF_DEP_PREFIX + chunk.id;
|
|
35
|
+
chunk.ids = [chunk.id];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
DepChunkIdPrefixPlugin
|
|
44
|
+
});
|
|
@@ -1,28 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/webpackPlugins/stripSourceMapUrlPlugin.ts
|
|
20
|
+
var stripSourceMapUrlPlugin_exports = {};
|
|
21
|
+
__export(stripSourceMapUrlPlugin_exports, {
|
|
22
|
+
StripSourceMapUrlPlugin: () => StripSourceMapUrlPlugin
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(stripSourceMapUrlPlugin_exports);
|
|
25
|
+
var StripSourceMapUrlPlugin = class {
|
|
26
|
+
constructor(opts) {
|
|
27
|
+
this.opts = opts;
|
|
28
|
+
}
|
|
29
|
+
apply(compiler) {
|
|
30
|
+
compiler.hooks.compilation.tap("StripSourceMapUrlPlugin", (compilation) => {
|
|
31
|
+
compilation.hooks.processAssets.tap({
|
|
32
|
+
name: "StripSourceMapUrlPlugin",
|
|
33
|
+
stage: this.opts.webpack.Compilation.PROCESS_ASSETS_STAGE_DERIVE
|
|
34
|
+
}, (assets) => {
|
|
35
|
+
Object.keys(assets).filter((filename) => /\.js$/.test(filename)).forEach((filename) => {
|
|
36
|
+
const asset = assets[filename];
|
|
37
|
+
const source = asset.source().toString().replace(/# sourceMappingURL=(.+?\.map)/g, "# $1");
|
|
38
|
+
compilation.updateAsset(filename, new this.opts.webpack.sources.RawSource(source));
|
|
25
39
|
});
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
+
0 && (module.exports = {
|
|
46
|
+
StripSourceMapUrlPlugin
|
|
47
|
+
});
|
|
@@ -1,15 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/webpackPlugins/writeCachePlugin.ts
|
|
20
|
+
var writeCachePlugin_exports = {};
|
|
21
|
+
__export(writeCachePlugin_exports, {
|
|
22
|
+
WriteCachePlugin: () => WriteCachePlugin
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(writeCachePlugin_exports);
|
|
25
|
+
var PLUGIN_NAME = "MFSUWriteCache";
|
|
26
|
+
var WriteCachePlugin = class {
|
|
27
|
+
constructor(opts) {
|
|
28
|
+
this.opts = opts;
|
|
29
|
+
}
|
|
30
|
+
apply(compiler) {
|
|
31
|
+
compiler.cache.hooks.store.tap({ name: PLUGIN_NAME, stage: 10 }, () => {
|
|
32
|
+
this.opts.onWriteCache();
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
WriteCachePlugin
|
|
39
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/mfsu",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.10",
|
|
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",
|
|
@@ -17,19 +17,20 @@
|
|
|
17
17
|
"vendors"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "
|
|
20
|
+
"build": "umi-scripts father build",
|
|
21
21
|
"build:deps": "umi-scripts bundleDeps",
|
|
22
|
-
"dev": "
|
|
22
|
+
"dev": "umi-scripts father dev",
|
|
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.10",
|
|
27
|
+
"@umijs/bundler-utils": "4.0.10",
|
|
28
|
+
"@umijs/utils": "4.0.10",
|
|
29
29
|
"enhanced-resolve": "5.9.3",
|
|
30
30
|
"is-equal": "^1.6.4"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
+
"is-absolute-url": "^3.0.3",
|
|
33
34
|
"mrmime": "1.0.0",
|
|
34
35
|
"webpack": "5.72.1",
|
|
35
36
|
"webpack-virtual-modules": "0.4.3"
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
],
|
|
43
44
|
"compiledConfig": {
|
|
44
45
|
"deps": [
|
|
46
|
+
"is-absolute-url",
|
|
45
47
|
"mrmime",
|
|
46
48
|
"webpack-virtual-modules"
|
|
47
49
|
],
|