@module-federation/data-prefetch 1.0.16 → 2.0.1
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/LICENSE +1 -1
- package/README.md +3 -1
- package/dist/LICENSE +21 -0
- package/dist/babel.cjs +95 -0
- package/dist/babel.d.ts +1 -0
- package/dist/babel.js +5 -0
- package/dist/cli/babel.cjs +115 -0
- package/dist/cli/babel.d.ts +2 -4
- package/dist/cli/babel.js +50 -82
- package/dist/cli/index.cjs +217 -0
- package/dist/cli/index.d.ts +5 -8
- package/dist/cli/index.js +150 -197
- package/dist/cli.cjs +95 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +5 -0
- package/dist/common/constant.cjs +51 -0
- package/dist/common/constant.d.ts +1 -0
- package/dist/common/constant.js +5 -0
- package/dist/common/index.cjs +95 -0
- package/dist/common/index.js +5 -0
- package/dist/common/node-utils.cjs +100 -0
- package/dist/common/node-utils.d.ts +2 -0
- package/dist/common/node-utils.js +35 -0
- package/dist/common/runtime-utils.cjs +84 -0
- package/dist/common/runtime-utils.d.ts +5 -0
- package/dist/common/runtime-utils.js +29 -0
- package/dist/constant.cjs +51 -0
- package/dist/constant.d.ts +1 -0
- package/dist/constant.js +5 -0
- package/dist/index.cjs +106 -0
- package/dist/index.d.ts +2 -5
- package/dist/index.js +3 -346
- package/dist/logger/index.cjs +60 -0
- package/dist/logger/index.d.ts +2 -0
- package/dist/logger/index.js +10 -0
- package/dist/plugin.cjs +234 -0
- package/dist/plugin.d.ts +3 -5
- package/dist/plugin.js +167 -340
- package/dist/prefetch.cjs +197 -0
- package/dist/{prefetch-4e9646e4.d.ts → prefetch.d.ts} +14 -17
- package/dist/prefetch.js +149 -0
- package/dist/react/hooks.cjs +144 -0
- package/dist/react/hooks.d.ts +11 -0
- package/dist/react/hooks.js +86 -0
- package/dist/react/index.cjs +95 -0
- package/dist/react/index.d.ts +1 -16
- package/dist/react/index.js +2 -283
- package/dist/react/utils.cjs +65 -0
- package/dist/react/utils.d.ts +1 -0
- package/dist/react/utils.js +15 -0
- package/dist/react.cjs +95 -0
- package/dist/react.d.ts +1 -0
- package/dist/react.js +5 -0
- package/dist/universal/index.cjs +81 -0
- package/dist/universal/index.d.ts +2 -8
- package/dist/universal/index.js +24 -196
- package/dist/universal.cjs +95 -0
- package/dist/universal.d.ts +1 -0
- package/dist/universal.js +5 -0
- package/package.json +76 -40
- package/CHANGELOG.md +0 -9
- package/__tests__/babel.spec.ts +0 -75
- package/__tests__/prefetch.spec.ts +0 -138
- package/__tests__/react.spec.ts +0 -119
- package/dist/esm/chunk-AJPO2B2T.js +0 -30
- package/dist/esm/chunk-EZUCZHGV.js +0 -11
- package/dist/esm/chunk-ISLXMAIA.js +0 -155
- package/dist/esm/chunk-KI4QGPIS.js +0 -32
- package/dist/esm/chunk-TTJJJ2WZ.js +0 -7
- package/dist/esm/chunk-VVZ6XIM6.js +0 -166
- package/dist/esm/cli/babel.js +0 -57
- package/dist/esm/cli/index.js +0 -178
- package/dist/esm/index.js +0 -13
- package/dist/esm/plugin.js +0 -12
- package/dist/esm/react/index.js +0 -94
- package/dist/esm/shared/index.js +0 -27
- package/dist/esm/universal/index.js +0 -9
- package/dist/shared/index.d.ts +0 -5
- package/dist/shared/index.js +0 -48
- package/jest.config.js +0 -29
- package/project.json +0 -21
- package/src/cli/babel.ts +0 -94
- package/src/cli/index.ts +0 -171
- package/src/common/constant.ts +0 -1
- package/src/common/node-utils.ts +0 -24
- package/src/common/runtime-utils.ts +0 -34
- package/src/index.ts +0 -2
- package/src/logger/index.ts +0 -3
- package/src/plugin.ts +0 -191
- package/src/prefetch.ts +0 -207
- package/src/react/hooks.ts +0 -95
- package/src/react/index.ts +0 -1
- package/src/react/utils.ts +0 -11
- package/src/shared/index.ts +0 -26
- package/src/universal/index.ts +0 -27
- package/tsconfig.json +0 -27
- package/tsup.config.ts +0 -35
- /package/{src/common/index.ts → dist/common/index.d.ts} +0 -0
package/dist/cli/index.js
CHANGED
|
@@ -1,205 +1,158 @@
|
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// src/common/constant.ts
|
|
39
|
-
var TEMP_DIR = ".mf";
|
|
40
|
-
|
|
41
|
-
// src/common/node-utils.ts
|
|
42
|
-
var import_path = __toESM(require("path"));
|
|
43
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
44
|
-
var fileExistsWithCaseSync = (filepath) => {
|
|
45
|
-
const dir = import_path.default.dirname(filepath);
|
|
46
|
-
if (filepath === "/" || filepath === ".") {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
const filenames = import_fs_extra.default.readdirSync(dir);
|
|
50
|
-
if (filenames.indexOf(import_path.default.basename(filepath)) === -1) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
return fileExistsWithCaseSync(dir);
|
|
54
|
-
};
|
|
55
|
-
var fixPrefetchPath = (exposePath) => {
|
|
56
|
-
const pathExt = [".js", ".ts"];
|
|
57
|
-
const extReg = /\.(ts|js|tsx|jsx)$/;
|
|
58
|
-
if (extReg.test(exposePath)) {
|
|
59
|
-
return pathExt.map((ext) => exposePath.replace(extReg, `.prefetch${ext}`));
|
|
60
|
-
} else {
|
|
61
|
-
return pathExt.map((ext) => exposePath + `.prefetch${ext}`);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
// src/common/runtime-utils.ts
|
|
66
|
-
var import_runtime = require("@module-federation/runtime");
|
|
67
|
-
var import_sdk = require("@module-federation/sdk");
|
|
68
|
-
var getPrefetchId = (id) => (0, import_sdk.encodeName)(`${id}/${import_sdk.MFPrefetchCommon.identifier}`);
|
|
69
|
-
|
|
70
|
-
// src/cli/index.ts
|
|
71
|
-
var { RuntimeGlobals, Template } = require((0, import_normalize_webpack_path.normalizeWebpackPath)("webpack"));
|
|
1
|
+
import path from "path";
|
|
2
|
+
import fs_extra from "fs-extra";
|
|
3
|
+
import { MFPrefetchCommon, bindLoggerToCompiler, createInfrastructureLogger, createLogger, encodeName } from "@module-federation/sdk";
|
|
4
|
+
import { normalizeWebpackPath } from "@module-federation/sdk/normalize-webpack-path";
|
|
5
|
+
import { TEMP_DIR } from "../common/constant.js";
|
|
6
|
+
import { fileExistsWithCaseSync, fixPrefetchPath } from "../common/node-utils.js";
|
|
7
|
+
import { getPrefetchId } from "../common/runtime-utils.js";
|
|
8
|
+
import { SHARED_STRATEGY } from "../constant.js";
|
|
9
|
+
|
|
10
|
+
;// CONCATENATED MODULE: external "path"
|
|
11
|
+
|
|
12
|
+
;// CONCATENATED MODULE: external "fs-extra"
|
|
13
|
+
|
|
14
|
+
;// CONCATENATED MODULE: external "@module-federation/sdk"
|
|
15
|
+
|
|
16
|
+
;// CONCATENATED MODULE: external "@module-federation/sdk/normalize-webpack-path"
|
|
17
|
+
|
|
18
|
+
;// CONCATENATED MODULE: external "../common/constant.js"
|
|
19
|
+
|
|
20
|
+
;// CONCATENATED MODULE: external "../common/node-utils.js"
|
|
21
|
+
|
|
22
|
+
;// CONCATENATED MODULE: external "../common/runtime-utils.js"
|
|
23
|
+
|
|
24
|
+
;// CONCATENATED MODULE: external "../constant.js"
|
|
25
|
+
|
|
26
|
+
;// CONCATENATED MODULE: ./src/cli/index.ts
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
const { RuntimeGlobals, Template } = require(normalizeWebpackPath('webpack'));
|
|
36
|
+
const createBundlerLogger = typeof createInfrastructureLogger === 'function' ? createInfrastructureLogger : createLogger;
|
|
37
|
+
const logger = createBundlerLogger('[ Module Federation Data Prefetch Plugin ]');
|
|
72
38
|
function getFederationGlobalScope(runtimeGlobals) {
|
|
73
|
-
|
|
39
|
+
return `${runtimeGlobals.require || '__webpack_require__'}.federation`;
|
|
74
40
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
41
|
+
class PrefetchPlugin {
|
|
42
|
+
// eslint-disable-next-line max-lines-per-function
|
|
43
|
+
apply(compiler) {
|
|
44
|
+
var _this_options_runtimePlugins;
|
|
45
|
+
bindLoggerToCompiler(logger, compiler, 'PrefetchPlugin');
|
|
46
|
+
const { name, exposes } = this.options;
|
|
47
|
+
if (!exposes) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (!compiler.options.context) {
|
|
51
|
+
throw new Error('compiler.options.context is not defined');
|
|
52
|
+
}
|
|
53
|
+
const { runtimePlugins } = this.options;
|
|
54
|
+
if (!Array.isArray(runtimePlugins)) {
|
|
55
|
+
this.options.runtimePlugins = [];
|
|
56
|
+
}
|
|
57
|
+
const runtimePath = path.resolve(__dirname, './plugin.esm.js');
|
|
58
|
+
if (!((_this_options_runtimePlugins = this.options.runtimePlugins) === null || _this_options_runtimePlugins === void 0 ? void 0 : _this_options_runtimePlugins.includes(runtimePath))) {
|
|
59
|
+
this.options.runtimePlugins.push(runtimePath);
|
|
60
|
+
}
|
|
61
|
+
if (this.options.shareStrategy !== SHARED_STRATEGY) {
|
|
62
|
+
this.options.shareStrategy = SHARED_STRATEGY;
|
|
63
|
+
logger.warn(`[Module Federation Data Prefetch]: Your shared strategy is set to '${SHARED_STRATEGY}', this is a necessary condition for data prefetch`);
|
|
64
|
+
}
|
|
65
|
+
const encodedName = encodeName(name);
|
|
66
|
+
const asyncEntryPath = path.resolve(compiler.options.context, `node_modules/${TEMP_DIR}/${encodedName}/bootstrap.js`);
|
|
67
|
+
if (fs_extra.existsSync(asyncEntryPath)) {
|
|
68
|
+
fs_extra.unlinkSync(asyncEntryPath);
|
|
69
|
+
}
|
|
70
|
+
if (!this.options.dataPrefetch) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const prefetchs = [];
|
|
74
|
+
const exposeAlias = Object.keys(exposes);
|
|
75
|
+
exposeAlias.forEach((alias)=>{
|
|
76
|
+
let exposePath;
|
|
77
|
+
// @ts-ignore
|
|
78
|
+
const exposeValue = exposes[alias];
|
|
79
|
+
if (typeof exposeValue === 'string') {
|
|
80
|
+
exposePath = exposeValue;
|
|
81
|
+
} else {
|
|
82
|
+
exposePath = exposeValue.import[0];
|
|
83
|
+
}
|
|
84
|
+
const targetPaths = fixPrefetchPath(exposePath);
|
|
85
|
+
for (const pathItem of targetPaths){
|
|
86
|
+
const absolutePath = path.resolve(compiler.options.context, pathItem);
|
|
87
|
+
if (fileExistsWithCaseSync(absolutePath)) {
|
|
88
|
+
prefetchs.push(pathItem);
|
|
89
|
+
const absoluteAlias = alias.replace('.', '');
|
|
90
|
+
this._reWriteExports += `export * as ${getPrefetchId(`${name}${absoluteAlias}`)} from '${absolutePath}';\n`;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
if (!this._reWriteExports) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const tempDirRealPath = path.resolve(compiler.options.context, 'node_modules', TEMP_DIR);
|
|
99
|
+
if (!fs_extra.existsSync(tempDirRealPath)) {
|
|
100
|
+
fs_extra.mkdirSync(tempDirRealPath);
|
|
101
|
+
}
|
|
102
|
+
if (!fs_extra.existsSync(`${tempDirRealPath}/${encodedName}`)) {
|
|
103
|
+
fs_extra.mkdirSync(`${tempDirRealPath}/${encodedName}`);
|
|
104
|
+
}
|
|
105
|
+
fs_extra.writeFileSync(asyncEntryPath, this._reWriteExports);
|
|
106
|
+
new compiler.webpack.DefinePlugin({
|
|
107
|
+
FederationDataPrefetch: JSON.stringify(asyncEntryPath)
|
|
108
|
+
}).apply(compiler);
|
|
111
109
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const exposeValue = exposes[alias];
|
|
117
|
-
if (typeof exposeValue === "string") {
|
|
118
|
-
exposePath = exposeValue;
|
|
119
|
-
} else {
|
|
120
|
-
exposePath = exposeValue.import[0];
|
|
121
|
-
}
|
|
122
|
-
const targetPaths = fixPrefetchPath(exposePath);
|
|
123
|
-
for (const pathItem of targetPaths) {
|
|
124
|
-
const absolutePath = import_path2.default.resolve(compiler.options.context, pathItem);
|
|
125
|
-
if (fileExistsWithCaseSync(absolutePath)) {
|
|
126
|
-
prefetchs.push(pathItem);
|
|
127
|
-
const absoluteAlias = alias.replace(".", "");
|
|
128
|
-
this._reWriteExports += `export * as ${getPrefetchId(
|
|
129
|
-
`${name}${absoluteAlias}`
|
|
130
|
-
)} from '${absolutePath}';
|
|
131
|
-
`;
|
|
132
|
-
break;
|
|
110
|
+
static addRuntime(compiler, options) {
|
|
111
|
+
const encodedName = encodeName(options.name);
|
|
112
|
+
if (!compiler.options.context) {
|
|
113
|
+
throw new Error('compiler.options.context is not defined');
|
|
133
114
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
115
|
+
const prefetchEntry = path.resolve(compiler.options.context, `node_modules/.mf/${encodedName}/bootstrap.js`);
|
|
116
|
+
const federationGlobal = getFederationGlobalScope(RuntimeGlobals || {});
|
|
117
|
+
return Template.asString([
|
|
118
|
+
fs_extra.existsSync(prefetchEntry) ? Template.indent([
|
|
119
|
+
'function injectPrefetch() {',
|
|
120
|
+
Template.indent([
|
|
121
|
+
`globalThis.__FEDERATION__ = globalThis.__FEDERATION__ || {};`,
|
|
122
|
+
`globalThis.__FEDERATION__['${MFPrefetchCommon.globalKey}'] = globalThis.__FEDERATION__['${MFPrefetchCommon.globalKey}'] || {`,
|
|
123
|
+
`entryLoading: {},`,
|
|
124
|
+
`instance: new Map(),`,
|
|
125
|
+
`__PREFETCH_EXPORTS__: {},`,
|
|
126
|
+
`};`,
|
|
127
|
+
`globalThis.__FEDERATION__['${MFPrefetchCommon.globalKey}']['${MFPrefetchCommon.exportsKey}'] = globalThis.__FEDERATION__['${MFPrefetchCommon.globalKey}']['${MFPrefetchCommon.exportsKey}'] || {};`,
|
|
128
|
+
`globalThis.__FEDERATION__['${MFPrefetchCommon.globalKey}']['${MFPrefetchCommon.exportsKey}']['${options.name}'] = function(){ return import('${prefetchEntry}');}`
|
|
129
|
+
]),
|
|
130
|
+
'}',
|
|
131
|
+
`${federationGlobal}.prefetch = injectPrefetch`
|
|
132
|
+
]) : '',
|
|
133
|
+
Template.indent([
|
|
134
|
+
`if(!${federationGlobal}.isMFRemote && ${federationGlobal}.prefetch){`,
|
|
135
|
+
`${federationGlobal}.prefetch()`,
|
|
136
|
+
'}'
|
|
137
|
+
])
|
|
138
|
+
]);
|
|
138
139
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
if (!import_fs_extra2.default.existsSync(tempDirRealPath)) {
|
|
145
|
-
import_fs_extra2.default.mkdirSync(tempDirRealPath);
|
|
140
|
+
static setRemoteIdentifier() {
|
|
141
|
+
const federationGlobal = getFederationGlobalScope(RuntimeGlobals || {});
|
|
142
|
+
return Template.indent([
|
|
143
|
+
`${federationGlobal}.isMFRemote = true;`
|
|
144
|
+
]);
|
|
146
145
|
}
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
static removeRemoteIdentifier() {
|
|
147
|
+
const federationGlobal = getFederationGlobalScope(RuntimeGlobals || {});
|
|
148
|
+
return Template.indent([
|
|
149
|
+
`${federationGlobal}.isMFRemote = false;`
|
|
150
|
+
]);
|
|
149
151
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}).apply(compiler);
|
|
154
|
-
}
|
|
155
|
-
static addRuntime(compiler, options) {
|
|
156
|
-
const encodedName = (0, import_sdk2.encodeName)(options.name);
|
|
157
|
-
if (!compiler.options.context) {
|
|
158
|
-
throw new Error("compiler.options.context is not defined");
|
|
152
|
+
constructor(options){
|
|
153
|
+
this.options = options;
|
|
154
|
+
this._reWriteExports = '';
|
|
159
155
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
);
|
|
164
|
-
const federationGlobal = getFederationGlobalScope(
|
|
165
|
-
RuntimeGlobals || {}
|
|
166
|
-
);
|
|
167
|
-
return Template.asString([
|
|
168
|
-
import_fs_extra2.default.existsSync(prefetchEntry) ? Template.indent([
|
|
169
|
-
"function injectPrefetch() {",
|
|
170
|
-
`globalThis.__FEDERATION__ = globalThis.__FEDERATION__ || {};`,
|
|
171
|
-
`globalThis.__FEDERATION__['${import_sdk2.MFPrefetchCommon.globalKey}'] = globalThis.__FEDERATION__['${import_sdk2.MFPrefetchCommon.globalKey}'] || {`,
|
|
172
|
-
`entryLoading: {},`,
|
|
173
|
-
`instance: new Map(),`,
|
|
174
|
-
`__PREFETCH_EXPORTS__: {},`,
|
|
175
|
-
`};`,
|
|
176
|
-
`globalThis.__FEDERATION__['${import_sdk2.MFPrefetchCommon.globalKey}']['${import_sdk2.MFPrefetchCommon.exportsKey}'] = globalThis.__FEDERATION__['${import_sdk2.MFPrefetchCommon.globalKey}']['${import_sdk2.MFPrefetchCommon.exportsKey}'] || {};`,
|
|
177
|
-
`globalThis.__FEDERATION__['${import_sdk2.MFPrefetchCommon.globalKey}']['${import_sdk2.MFPrefetchCommon.exportsKey}']['${options.name}'] = import('${prefetchEntry}');`,
|
|
178
|
-
"}",
|
|
179
|
-
`${federationGlobal}.prefetch = injectPrefetch`
|
|
180
|
-
]) : "",
|
|
181
|
-
Template.indent([
|
|
182
|
-
`if(!${federationGlobal}.isMFRemote && ${federationGlobal}.prefetch){`,
|
|
183
|
-
`${federationGlobal}.prefetch()`,
|
|
184
|
-
"}"
|
|
185
|
-
])
|
|
186
|
-
]);
|
|
187
|
-
}
|
|
188
|
-
static setRemoteIdentifier() {
|
|
189
|
-
const federationGlobal = getFederationGlobalScope(
|
|
190
|
-
RuntimeGlobals || {}
|
|
191
|
-
);
|
|
192
|
-
return Template.indent([`${federationGlobal}.isMFRemote = true;`]);
|
|
193
|
-
}
|
|
194
|
-
static removeRemoteIdentifier() {
|
|
195
|
-
const federationGlobal = getFederationGlobalScope(
|
|
196
|
-
RuntimeGlobals || {}
|
|
197
|
-
);
|
|
198
|
-
return Template.indent([`${federationGlobal}.isMFRemote = false;`]);
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
202
|
-
0 && (module.exports = {
|
|
203
|
-
PrefetchPlugin,
|
|
204
|
-
getFederationGlobalScope
|
|
205
|
-
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export { PrefetchPlugin, getFederationGlobalScope };
|
package/dist/cli.cjs
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
var __webpack_modules__ = ({
|
|
10
|
+
"./cli/index": (function (module) {
|
|
11
|
+
module.exports = require("./cli/index.cjs");
|
|
12
|
+
|
|
13
|
+
}),
|
|
14
|
+
|
|
15
|
+
});
|
|
16
|
+
/************************************************************************/
|
|
17
|
+
// The module cache
|
|
18
|
+
var __webpack_module_cache__ = {};
|
|
19
|
+
|
|
20
|
+
// The require function
|
|
21
|
+
function __webpack_require__(moduleId) {
|
|
22
|
+
|
|
23
|
+
// Check if module is in cache
|
|
24
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
25
|
+
if (cachedModule !== undefined) {
|
|
26
|
+
return cachedModule.exports;
|
|
27
|
+
}
|
|
28
|
+
// Create a new module (and put it into the cache)
|
|
29
|
+
var module = (__webpack_module_cache__[moduleId] = {
|
|
30
|
+
exports: {}
|
|
31
|
+
});
|
|
32
|
+
// Execute the module function
|
|
33
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
34
|
+
|
|
35
|
+
// Return the exports of the module
|
|
36
|
+
return module.exports;
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/************************************************************************/
|
|
41
|
+
// webpack/runtime/compat_get_default_export
|
|
42
|
+
(() => {
|
|
43
|
+
// getDefaultExport function for compatibility with non-ESM modules
|
|
44
|
+
__webpack_require__.n = (module) => {
|
|
45
|
+
var getter = module && module.__esModule ?
|
|
46
|
+
() => (module['default']) :
|
|
47
|
+
() => (module);
|
|
48
|
+
__webpack_require__.d(getter, { a: getter });
|
|
49
|
+
return getter;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
})();
|
|
53
|
+
// webpack/runtime/define_property_getters
|
|
54
|
+
(() => {
|
|
55
|
+
__webpack_require__.d = (exports, definition) => {
|
|
56
|
+
for(var key in definition) {
|
|
57
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
58
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
})();
|
|
63
|
+
// webpack/runtime/has_own_property
|
|
64
|
+
(() => {
|
|
65
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
66
|
+
})();
|
|
67
|
+
// webpack/runtime/make_namespace_object
|
|
68
|
+
(() => {
|
|
69
|
+
// define __esModule on exports
|
|
70
|
+
__webpack_require__.r = (exports) => {
|
|
71
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
72
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
73
|
+
}
|
|
74
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
75
|
+
};
|
|
76
|
+
})();
|
|
77
|
+
/************************************************************************/
|
|
78
|
+
var __webpack_exports__ = {};
|
|
79
|
+
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
80
|
+
(() => {
|
|
81
|
+
__webpack_require__.r(__webpack_exports__);
|
|
82
|
+
/* ESM import */var _cli_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./cli/index");
|
|
83
|
+
/* ESM import */var _cli_index__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_cli_index__WEBPACK_IMPORTED_MODULE_0__);
|
|
84
|
+
|
|
85
|
+
/* ESM reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
86
|
+
/* ESM reexport (unknown) */ for( var __WEBPACK_IMPORT_KEY__ in _cli_index__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] =function(key) { return _cli_index__WEBPACK_IMPORTED_MODULE_0__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
|
|
87
|
+
/* ESM reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
})();
|
|
91
|
+
|
|
92
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
93
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
94
|
+
}
|
|
95
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './cli/index';
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
// The require scope
|
|
10
|
+
var __webpack_require__ = {};
|
|
11
|
+
|
|
12
|
+
/************************************************************************/
|
|
13
|
+
// webpack/runtime/define_property_getters
|
|
14
|
+
(() => {
|
|
15
|
+
__webpack_require__.d = (exports, definition) => {
|
|
16
|
+
for(var key in definition) {
|
|
17
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
18
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
})();
|
|
23
|
+
// webpack/runtime/has_own_property
|
|
24
|
+
(() => {
|
|
25
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
26
|
+
})();
|
|
27
|
+
// webpack/runtime/make_namespace_object
|
|
28
|
+
(() => {
|
|
29
|
+
// define __esModule on exports
|
|
30
|
+
__webpack_require__.r = (exports) => {
|
|
31
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
32
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
/************************************************************************/
|
|
38
|
+
var __webpack_exports__ = {};
|
|
39
|
+
__webpack_require__.r(__webpack_exports__);
|
|
40
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
41
|
+
TEMP_DIR: () => (TEMP_DIR)
|
|
42
|
+
});
|
|
43
|
+
const TEMP_DIR = '.mf';
|
|
44
|
+
|
|
45
|
+
exports.TEMP_DIR = __webpack_exports__.TEMP_DIR;
|
|
46
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
47
|
+
if(["TEMP_DIR"].indexOf(__webpack_i__) === -1) {
|
|
48
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TEMP_DIR = ".mf";
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
3
|
+
return typeof document === 'undefined'
|
|
4
|
+
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
5
|
+
: (document.currentScript && document.currentScript.src) ||
|
|
6
|
+
new URL('main.js', document.baseURI).href;
|
|
7
|
+
})();
|
|
8
|
+
;
|
|
9
|
+
var __webpack_modules__ = ({
|
|
10
|
+
"./constant": (function (module) {
|
|
11
|
+
module.exports = require("./constant.cjs");
|
|
12
|
+
|
|
13
|
+
}),
|
|
14
|
+
|
|
15
|
+
});
|
|
16
|
+
/************************************************************************/
|
|
17
|
+
// The module cache
|
|
18
|
+
var __webpack_module_cache__ = {};
|
|
19
|
+
|
|
20
|
+
// The require function
|
|
21
|
+
function __webpack_require__(moduleId) {
|
|
22
|
+
|
|
23
|
+
// Check if module is in cache
|
|
24
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
25
|
+
if (cachedModule !== undefined) {
|
|
26
|
+
return cachedModule.exports;
|
|
27
|
+
}
|
|
28
|
+
// Create a new module (and put it into the cache)
|
|
29
|
+
var module = (__webpack_module_cache__[moduleId] = {
|
|
30
|
+
exports: {}
|
|
31
|
+
});
|
|
32
|
+
// Execute the module function
|
|
33
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
34
|
+
|
|
35
|
+
// Return the exports of the module
|
|
36
|
+
return module.exports;
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/************************************************************************/
|
|
41
|
+
// webpack/runtime/compat_get_default_export
|
|
42
|
+
(() => {
|
|
43
|
+
// getDefaultExport function for compatibility with non-ESM modules
|
|
44
|
+
__webpack_require__.n = (module) => {
|
|
45
|
+
var getter = module && module.__esModule ?
|
|
46
|
+
() => (module['default']) :
|
|
47
|
+
() => (module);
|
|
48
|
+
__webpack_require__.d(getter, { a: getter });
|
|
49
|
+
return getter;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
})();
|
|
53
|
+
// webpack/runtime/define_property_getters
|
|
54
|
+
(() => {
|
|
55
|
+
__webpack_require__.d = (exports, definition) => {
|
|
56
|
+
for(var key in definition) {
|
|
57
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
58
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
})();
|
|
63
|
+
// webpack/runtime/has_own_property
|
|
64
|
+
(() => {
|
|
65
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
66
|
+
})();
|
|
67
|
+
// webpack/runtime/make_namespace_object
|
|
68
|
+
(() => {
|
|
69
|
+
// define __esModule on exports
|
|
70
|
+
__webpack_require__.r = (exports) => {
|
|
71
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
72
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
73
|
+
}
|
|
74
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
75
|
+
};
|
|
76
|
+
})();
|
|
77
|
+
/************************************************************************/
|
|
78
|
+
var __webpack_exports__ = {};
|
|
79
|
+
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
80
|
+
(() => {
|
|
81
|
+
__webpack_require__.r(__webpack_exports__);
|
|
82
|
+
/* ESM import */var _constant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./constant");
|
|
83
|
+
/* ESM import */var _constant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_constant__WEBPACK_IMPORTED_MODULE_0__);
|
|
84
|
+
|
|
85
|
+
/* ESM reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
86
|
+
/* ESM reexport (unknown) */ for( var __WEBPACK_IMPORT_KEY__ in _constant__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] =function(key) { return _constant__WEBPACK_IMPORTED_MODULE_0__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
|
|
87
|
+
/* ESM reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
})();
|
|
91
|
+
|
|
92
|
+
for(var __webpack_i__ in __webpack_exports__) {
|
|
93
|
+
exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
94
|
+
}
|
|
95
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|