@umijs/mfsu 4.0.6 → 4.0.9
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 +184 -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 +1 -1
- package/dist/mfsu/mfsu.js +231 -257
- package/dist/mfsu/strategyCompileTime.js +123 -99
- package/dist/mfsu/strategyStaticAnalyze.js +135 -117
- 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 +230 -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,206 +1,239 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
this.mfsu = opts.mfsu;
|
|
21
|
-
this.include = this.mfsu.opts.include || [];
|
|
22
|
-
this.opts = opts;
|
|
23
|
-
this.cacheFilePath = (0, path_1.join)(this.opts.mfsu.opts.tmpBase, 'MFSU_CACHE_v4.json');
|
|
24
|
-
this.cwd = this.mfsu.opts.cwd;
|
|
25
|
-
opts.srcCodeCache.register((info) => {
|
|
26
|
-
this.produced.push({ changes: info.events });
|
|
27
|
-
this.currentDep = this._getDependencies(info.code, info.imports);
|
|
28
|
-
});
|
|
29
|
-
this.runtimeSimulations = [
|
|
30
|
-
{
|
|
31
|
-
packageName: 'antd',
|
|
32
|
-
handleImports: (0, babel_plugin_import_1.default)({
|
|
33
|
-
libraryName: 'antd',
|
|
34
|
-
style: true,
|
|
35
|
-
libraryDirectory: 'es',
|
|
36
|
-
}),
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
packageName: '@alipay/bigfish/antd',
|
|
40
|
-
handleImports: (0, babel_plugin_import_1.default)({
|
|
41
|
-
libraryName: '@alipay/bigfish/antd',
|
|
42
|
-
style: true,
|
|
43
|
-
libraryDirectory: 'es',
|
|
44
|
-
}),
|
|
45
|
-
},
|
|
46
|
-
];
|
|
47
|
-
}
|
|
48
|
-
getProducedEvent() {
|
|
49
|
-
return this.produced;
|
|
50
|
-
}
|
|
51
|
-
consumeAllProducedEvents() {
|
|
52
|
-
this.produced = [];
|
|
53
|
-
}
|
|
54
|
-
shouldBuild() {
|
|
55
|
-
if (utils_1.lodash.isEqual(this.builtWithDep, this.currentDep)) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
if (process.env.DEBUG_UMI) {
|
|
60
|
-
const reason = (0, why_1.default)(this.builtWithDep, this.currentDep);
|
|
61
|
-
utils_1.logger.info('[MFSU][eager]: isEqual(oldDep,newDep) === false, because ', reason);
|
|
62
|
-
}
|
|
63
|
-
return 'dependencies changed';
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
getDepModules() {
|
|
67
|
-
const map = this.getDependencies();
|
|
68
|
-
const staticDeps = {};
|
|
69
|
-
const keys = Object.keys(map);
|
|
70
|
-
for (const k of keys) {
|
|
71
|
-
staticDeps[k] = {
|
|
72
|
-
file: k,
|
|
73
|
-
version: map[k].version,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
return staticDeps;
|
|
77
|
-
}
|
|
78
|
-
snapshot() {
|
|
79
|
-
this.builtWithDep = this.currentDep;
|
|
80
|
-
}
|
|
81
|
-
loadCache() {
|
|
82
|
-
if ((0, fs_1.existsSync)(this.cacheFilePath)) {
|
|
83
|
-
this.builtWithDep = JSON.parse((0, fs_1.readFileSync)(this.cacheFilePath, 'utf-8'));
|
|
84
|
-
utils_1.logger.info('[MFSU][eager] restored cache');
|
|
85
|
-
}
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
86
20
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __export = (target, all) => {
|
|
25
|
+
for (var name in all)
|
|
26
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
27
|
+
};
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
33
|
+
}
|
|
34
|
+
return to;
|
|
35
|
+
};
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
+
|
|
39
|
+
// staticDepInfo.ts
|
|
40
|
+
var staticDepInfo_exports = {};
|
|
41
|
+
__export(staticDepInfo_exports, {
|
|
42
|
+
StaticDepInfo: () => StaticDepInfo
|
|
43
|
+
});
|
|
44
|
+
module.exports = __toCommonJS(staticDepInfo_exports);
|
|
45
|
+
var import_utils = require("@umijs/utils");
|
|
46
|
+
var import_fs = require("fs");
|
|
47
|
+
var import_why = __toESM(require("is-equal/why"));
|
|
48
|
+
var import_path = require("path");
|
|
49
|
+
var import_checkMatch = require("../babelPlugins/awaitImport/checkMatch");
|
|
50
|
+
var import_dep = require("../dep/dep");
|
|
51
|
+
var import_babel_plugin_import = __toESM(require("./simulations/babel-plugin-import"));
|
|
52
|
+
var StaticDepInfo = class {
|
|
53
|
+
constructor(opts) {
|
|
54
|
+
this.currentDep = {};
|
|
55
|
+
this.builtWithDep = {};
|
|
56
|
+
this.produced = [];
|
|
57
|
+
this.mfsu = opts.mfsu;
|
|
58
|
+
this.include = this.mfsu.opts.include || [];
|
|
59
|
+
this.opts = opts;
|
|
60
|
+
this.cacheFilePath = (0, import_path.join)(this.opts.mfsu.opts.tmpBase, "MFSU_CACHE_v4.json");
|
|
61
|
+
this.cwd = this.mfsu.opts.cwd;
|
|
62
|
+
opts.srcCodeCache.register((info) => {
|
|
63
|
+
this.produced.push({ changes: info.events });
|
|
64
|
+
this.currentDep = this._getDependencies(info.code, info.imports);
|
|
65
|
+
});
|
|
66
|
+
this.runtimeSimulations = [
|
|
67
|
+
{
|
|
68
|
+
packageName: "antd",
|
|
69
|
+
handleImports: (0, import_babel_plugin_import.default)({
|
|
70
|
+
libraryName: "antd",
|
|
71
|
+
style: true,
|
|
72
|
+
libraryDirectory: "es"
|
|
73
|
+
})
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
packageName: "@alipay/bigfish/antd",
|
|
77
|
+
handleImports: (0, import_babel_plugin_import.default)({
|
|
78
|
+
libraryName: "@alipay/bigfish/antd",
|
|
79
|
+
style: true,
|
|
80
|
+
libraryDirectory: "es"
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
getProducedEvent() {
|
|
86
|
+
return this.produced;
|
|
87
|
+
}
|
|
88
|
+
consumeAllProducedEvents() {
|
|
89
|
+
this.produced = [];
|
|
90
|
+
}
|
|
91
|
+
shouldBuild() {
|
|
92
|
+
if (import_utils.lodash.isEqual(this.builtWithDep, this.currentDep)) {
|
|
93
|
+
return false;
|
|
94
|
+
} else {
|
|
95
|
+
if (process.env.DEBUG_UMI) {
|
|
96
|
+
const reason = (0, import_why.default)(this.builtWithDep, this.currentDep);
|
|
97
|
+
import_utils.logger.info("[MFSU][eager]: isEqual(oldDep,newDep) === false, because ", reason);
|
|
98
|
+
}
|
|
99
|
+
return "dependencies changed";
|
|
99
100
|
}
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
}
|
|
102
|
+
getDepModules() {
|
|
103
|
+
const map = this.getDependencies();
|
|
104
|
+
const staticDeps = {};
|
|
105
|
+
const keys = Object.keys(map);
|
|
106
|
+
for (const k of keys) {
|
|
107
|
+
staticDeps[k] = {
|
|
108
|
+
file: k,
|
|
109
|
+
version: map[k].version
|
|
110
|
+
};
|
|
102
111
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
112
|
+
return staticDeps;
|
|
113
|
+
}
|
|
114
|
+
snapshot() {
|
|
115
|
+
this.builtWithDep = this.currentDep;
|
|
116
|
+
}
|
|
117
|
+
loadCache() {
|
|
118
|
+
if ((0, import_fs.existsSync)(this.cacheFilePath)) {
|
|
119
|
+
this.builtWithDep = JSON.parse((0, import_fs.readFileSync)(this.cacheFilePath, "utf-8"));
|
|
120
|
+
import_utils.logger.info("[MFSU][eager] restored cache");
|
|
106
121
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
remoteName: this.mfsu.opts.mfName,
|
|
114
|
-
alias: this.mfsu.alias,
|
|
115
|
-
externals: this.mfsu.externals,
|
|
116
|
-
};
|
|
117
|
-
const matched = {};
|
|
118
|
-
const unMatched = new Set();
|
|
119
|
-
const pkgNames = this.runtimeSimulations.map(({ packageName }) => packageName);
|
|
120
|
-
const groupedMockImports = {};
|
|
121
|
-
for (const imp of imports) {
|
|
122
|
-
if (pkgNames.indexOf(imp.n) >= 0) {
|
|
123
|
-
const name = imp.n;
|
|
124
|
-
if (groupedMockImports[name]) {
|
|
125
|
-
groupedMockImports[name].push(imp);
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
groupedMockImports[name] = [imp];
|
|
129
|
-
}
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
if (unMatched.has(imp.n)) {
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
if (matched[imp.n]) {
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
const match = (0, checkMatch_1.checkMatch)({
|
|
139
|
-
value: imp.n,
|
|
140
|
-
depth: 1,
|
|
141
|
-
filename: '_.js',
|
|
142
|
-
opts,
|
|
143
|
-
});
|
|
144
|
-
if (match.isMatch) {
|
|
145
|
-
matched[match.value] = {
|
|
146
|
-
...match,
|
|
147
|
-
version: dep_1.Dep.getDepVersion({
|
|
148
|
-
dep: match.value,
|
|
149
|
-
cwd,
|
|
150
|
-
}),
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
unMatched.add(imp.n);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
this.simulateRuntimeTransform(matched, groupedMockImports, bigCodeString);
|
|
158
|
-
this.appendIncludeList(matched, opts);
|
|
159
|
-
utils_1.logger.debug('[MFSU][eager] _getDependencies costs', Date.now() - start);
|
|
160
|
-
return matched;
|
|
122
|
+
}
|
|
123
|
+
writeCache() {
|
|
124
|
+
import_utils.fsExtra.mkdirpSync((0, import_path.dirname)(this.cacheFilePath));
|
|
125
|
+
const newContent = JSON.stringify(this.builtWithDep, null, 2);
|
|
126
|
+
if ((0, import_fs.existsSync)(this.cacheFilePath) && (0, import_fs.readFileSync)(this.cacheFilePath, "utf-8") === newContent) {
|
|
127
|
+
return;
|
|
161
128
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
129
|
+
import_utils.logger.info("[MFSU][eager] write cache");
|
|
130
|
+
(0, import_fs.writeFileSync)(this.cacheFilePath, newContent, "utf-8");
|
|
131
|
+
}
|
|
132
|
+
getCacheFilePath() {
|
|
133
|
+
return this.cacheFilePath;
|
|
134
|
+
}
|
|
135
|
+
getDependencies() {
|
|
136
|
+
return this.currentDep;
|
|
137
|
+
}
|
|
138
|
+
init() {
|
|
139
|
+
const merged = this.opts.srcCodeCache.getMergedCode();
|
|
140
|
+
this.currentDep = this._getDependencies(merged.code, merged.imports);
|
|
141
|
+
}
|
|
142
|
+
_getDependencies(bigCodeString, imports) {
|
|
143
|
+
const start = Date.now();
|
|
144
|
+
const cwd = this.mfsu.opts.cwd;
|
|
145
|
+
const opts = {
|
|
146
|
+
exportAllMembers: this.mfsu.opts.exportAllMembers,
|
|
147
|
+
unMatchLibs: this.mfsu.opts.unMatchLibs,
|
|
148
|
+
remoteName: this.mfsu.opts.mfName,
|
|
149
|
+
alias: this.mfsu.alias,
|
|
150
|
+
externals: this.mfsu.externals
|
|
151
|
+
};
|
|
152
|
+
const matched = {};
|
|
153
|
+
const unMatched = /* @__PURE__ */ new Set();
|
|
154
|
+
const pkgNames = this.runtimeSimulations.map(({ packageName }) => packageName);
|
|
155
|
+
const groupedMockImports = {};
|
|
156
|
+
for (const imp of imports) {
|
|
157
|
+
if (pkgNames.indexOf(imp.n) >= 0) {
|
|
158
|
+
const name = imp.n;
|
|
159
|
+
if (groupedMockImports[name]) {
|
|
160
|
+
groupedMockImports[name].push(imp);
|
|
161
|
+
} else {
|
|
162
|
+
groupedMockImports[name] = [imp];
|
|
181
163
|
}
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
if (unMatched.has(imp.n)) {
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if (matched[imp.n]) {
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
const match = (0, import_checkMatch.checkMatch)({
|
|
173
|
+
value: imp.n,
|
|
174
|
+
depth: 1,
|
|
175
|
+
filename: "_.js",
|
|
176
|
+
opts
|
|
177
|
+
});
|
|
178
|
+
if (match.isMatch) {
|
|
179
|
+
matched[match.value] = __spreadProps(__spreadValues({}, match), {
|
|
180
|
+
version: import_dep.Dep.getDepVersion({
|
|
181
|
+
dep: match.value,
|
|
182
|
+
cwd
|
|
183
|
+
})
|
|
184
|
+
});
|
|
185
|
+
} else {
|
|
186
|
+
unMatched.add(imp.n);
|
|
187
|
+
}
|
|
182
188
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
189
|
+
this.simulateRuntimeTransform(matched, groupedMockImports, bigCodeString);
|
|
190
|
+
this.appendIncludeList(matched, opts);
|
|
191
|
+
import_utils.logger.debug("[MFSU][eager] _getDependencies costs", Date.now() - start);
|
|
192
|
+
return matched;
|
|
193
|
+
}
|
|
194
|
+
simulateRuntimeTransform(matched, groupedImports, rawCode) {
|
|
195
|
+
for (const mock of this.runtimeSimulations) {
|
|
196
|
+
const name = mock.packageName;
|
|
197
|
+
const pathToVersion = (dep) => {
|
|
198
|
+
return import_dep.Dep.getDepVersion({
|
|
199
|
+
dep,
|
|
200
|
+
cwd: this.cwd
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
const ms = mock.handleImports({
|
|
204
|
+
imports: groupedImports[name],
|
|
205
|
+
rawCode,
|
|
206
|
+
alias: this.mfsu.alias,
|
|
207
|
+
mfName: this.mfsu.opts.mfName,
|
|
208
|
+
pathToVersion
|
|
209
|
+
});
|
|
210
|
+
for (const m of ms) {
|
|
211
|
+
matched[m.value] = m;
|
|
212
|
+
}
|
|
201
213
|
}
|
|
202
|
-
|
|
203
|
-
|
|
214
|
+
}
|
|
215
|
+
appendIncludeList(matched, opts) {
|
|
216
|
+
for (const p of this.include) {
|
|
217
|
+
const match = (0, import_checkMatch.checkMatch)({
|
|
218
|
+
value: p,
|
|
219
|
+
depth: 1,
|
|
220
|
+
filename: "_.js",
|
|
221
|
+
opts
|
|
222
|
+
});
|
|
223
|
+
if (match.isMatch) {
|
|
224
|
+
matched[match.value] = __spreadProps(__spreadValues({}, match), {
|
|
225
|
+
version: import_dep.Dep.getDepVersion({
|
|
226
|
+
dep: match.value,
|
|
227
|
+
cwd: this.cwd
|
|
228
|
+
})
|
|
229
|
+
});
|
|
230
|
+
}
|
|
204
231
|
}
|
|
205
|
-
}
|
|
206
|
-
|
|
232
|
+
}
|
|
233
|
+
async allRuntimeHelpers() {
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
237
|
+
0 && (module.exports = {
|
|
238
|
+
StaticDepInfo
|
|
239
|
+
});
|
package/dist/types.js
CHANGED
|
@@ -1,8 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
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
|
+
// types.ts
|
|
20
|
+
var types_exports = {};
|
|
21
|
+
__export(types_exports, {
|
|
22
|
+
Mode: () => Mode
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(types_exports);
|
|
25
|
+
var Mode = /* @__PURE__ */ ((Mode2) => {
|
|
26
|
+
Mode2["development"] = "development";
|
|
27
|
+
Mode2["production"] = "production";
|
|
28
|
+
return Mode2;
|
|
29
|
+
})(Mode || {});
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
Mode
|
|
33
|
+
});
|
package/dist/utils/makeArray.js
CHANGED
|
@@ -1,7 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
// makeArray.ts
|
|
20
|
+
var makeArray_exports = {};
|
|
21
|
+
__export(makeArray_exports, {
|
|
22
|
+
makeArray: () => makeArray
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(makeArray_exports);
|
|
4
25
|
function makeArray(item) {
|
|
5
|
-
|
|
26
|
+
return Array.isArray(item) ? item : [item];
|
|
6
27
|
}
|
|
7
|
-
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
makeArray
|
|
31
|
+
});
|
|
@@ -1,7 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
// trimFileContent.ts
|
|
20
|
+
var trimFileContent_exports = {};
|
|
21
|
+
__export(trimFileContent_exports, {
|
|
22
|
+
trimFileContent: () => trimFileContent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(trimFileContent_exports);
|
|
4
25
|
function trimFileContent(content) {
|
|
5
|
-
|
|
26
|
+
return content.trim() + "\n";
|
|
6
27
|
}
|
|
7
|
-
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
trimFileContent
|
|
31
|
+
});
|
|
@@ -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
|
+
});
|