@umijs/mfsu 4.0.7 → 4.0.8
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/babelPlugins/awaitImport/MFImport.d.ts +0 -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.d.ts +0 -0
- package/dist/babelPlugins/awaitImport/checkMatch.js +18 -3
- package/dist/babelPlugins/awaitImport/getAliasedPath.d.ts +0 -0
- package/dist/babelPlugins/awaitImport/getAliasedPath.js +54 -35
- package/dist/babelPlugins/awaitImport/getRealPath.d.ts +0 -0
- package/dist/babelPlugins/awaitImport/getRealPath.js +42 -21
- package/dist/babelPlugins/awaitImport/isExternals.d.ts +0 -0
- package/dist/babelPlugins/awaitImport/isExternals.js +55 -26
- package/dist/babelPlugins/awaitImport/parseSpecifiers.d.ts +0 -0
- package/dist/babelPlugins/awaitImport/parseSpecifiers.js +51 -52
- package/dist/constants.d.ts +0 -0
- package/dist/constants.js +47 -10
- package/dist/dep/dep.d.ts +0 -0
- package/dist/dep/dep.js +0 -0
- package/dist/dep/getCJSExports.d.ts +0 -0
- package/dist/dep/getCJSExports.js +60 -53
- package/dist/dep/getExposeFromContent.d.ts +0 -0
- package/dist/dep/getExposeFromContent.js +71 -59
- package/dist/dep/getModuleExports.d.ts +0 -0
- package/dist/dep/getModuleExports.js +58 -32
- package/dist/depBuilder/depBuilder.d.ts +0 -0
- package/dist/depBuilder/depBuilder.js +0 -0
- package/dist/depBuilder/getESBuildEntry.d.ts +0 -0
- package/dist/depBuilder/getESBuildEntry.js +35 -12
- package/dist/depInfo.d.ts +0 -0
- package/dist/depInfo.js +0 -0
- package/dist/esbuildHandlers/autoCssModules.d.ts +0 -0
- package/dist/esbuildHandlers/autoCssModules.js +0 -0
- package/dist/esbuildHandlers/awaitImport/index.d.ts +0 -0
- package/dist/esbuildHandlers/awaitImport/index.js +82 -70
- package/dist/index.d.ts +0 -0
- package/dist/index.js +32 -22
- package/dist/loader/esbuild.d.ts +0 -0
- package/dist/loader/esbuild.js +87 -35
- package/dist/mfsu/mfsu.d.ts +1 -1
- package/dist/mfsu/mfsu.js +0 -0
- package/dist/mfsu/strategyCompileTime.d.ts +0 -0
- package/dist/mfsu/strategyCompileTime.js +0 -0
- package/dist/mfsu/strategyStaticAnalyze.d.ts +0 -0
- package/dist/mfsu/strategyStaticAnalyze.js +0 -0
- package/dist/moduleGraph.d.ts +0 -0
- package/dist/moduleGraph.js +0 -0
- package/dist/staticDepInfo/importParser.d.ts +0 -0
- package/dist/staticDepInfo/importParser.js +28 -6
- package/dist/staticDepInfo/simulations/babel-plugin-import.d.ts +0 -0
- package/dist/staticDepInfo/simulations/babel-plugin-import.js +0 -0
- package/dist/staticDepInfo/staticDepInfo.d.ts +0 -0
- package/dist/staticDepInfo/staticDepInfo.js +0 -0
- package/dist/types.d.ts +0 -0
- package/dist/types.js +33 -8
- package/dist/utils/makeArray.d.ts +0 -0
- package/dist/utils/makeArray.js +29 -5
- package/dist/utils/trimFileContent.d.ts +0 -0
- package/dist/utils/trimFileContent.js +29 -5
- package/dist/webpackPlugins/buildDepPlugin.d.ts +0 -0
- package/dist/webpackPlugins/buildDepPlugin.js +49 -25
- package/dist/webpackPlugins/depChunkIdPrefixPlugin.d.ts +0 -0
- package/dist/webpackPlugins/depChunkIdPrefixPlugin.js +44 -19
- package/dist/webpackPlugins/stripSourceMapUrlPlugin.d.ts +0 -0
- package/dist/webpackPlugins/stripSourceMapUrlPlugin.js +46 -27
- package/dist/webpackPlugins/writeCachePlugin.d.ts +0 -0
- package/dist/webpackPlugins/writeCachePlugin.js +39 -15
- package/package.json +6 -6
|
@@ -1,25 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
+
// buildDepPlugin.ts
|
|
20
|
+
var buildDepPlugin_exports = {};
|
|
21
|
+
__export(buildDepPlugin_exports, {
|
|
22
|
+
BuildDepPlugin: () => BuildDepPlugin
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(buildDepPlugin_exports);
|
|
25
|
+
var PLUGIN_NAME = "MFSUBuildDeps";
|
|
26
|
+
var BuildDepPlugin = class {
|
|
27
|
+
constructor(opts) {
|
|
28
|
+
this.opts = opts;
|
|
29
|
+
}
|
|
30
|
+
apply(compiler) {
|
|
31
|
+
compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, (c) => {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
return ((_b = (_a = this.opts).onFileChange) == null ? void 0 : _b.call(_a, c)) || Promise.resolve();
|
|
34
|
+
});
|
|
35
|
+
compiler.hooks.beforeCompile.tap(PLUGIN_NAME, () => {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
(_b = (_a = this.opts).beforeCompile) == null ? void 0 : _b.call(_a);
|
|
38
|
+
});
|
|
39
|
+
compiler.hooks.done.tap(PLUGIN_NAME, (stats) => {
|
|
40
|
+
if (!stats.hasErrors()) {
|
|
41
|
+
this.opts.onCompileDone();
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
BuildDepPlugin
|
|
49
|
+
});
|
|
File without changes
|
|
@@ -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
|
+
// 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
|
+
});
|
|
File without changes
|
|
@@ -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
|
+
// 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
|
+
});
|
|
File without changes
|
|
@@ -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
|
+
// 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.8",
|
|
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,15 +17,15 @@
|
|
|
17
17
|
"vendors"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "pnpm
|
|
20
|
+
"build": "pnpm father build",
|
|
21
21
|
"build:deps": "umi-scripts bundleDeps",
|
|
22
|
-
"dev": "pnpm
|
|
22
|
+
"dev": "pnpm 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.8",
|
|
27
|
+
"@umijs/bundler-utils": "4.0.8",
|
|
28
|
+
"@umijs/utils": "4.0.8",
|
|
29
29
|
"enhanced-resolve": "5.9.3",
|
|
30
30
|
"is-equal": "^1.6.4"
|
|
31
31
|
},
|