@umijs/mfsu 4.0.0-canary.20220323.1 → 4.0.0-rc.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/dist/mfsu.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { NextFunction, Request, Response } from '@umijs/bundler-utils/compiled/express';
|
|
2
2
|
import webpack, { Configuration } from 'webpack';
|
|
3
|
-
import autoExport from './babelPlugins/autoExport';
|
|
4
3
|
import awaitImport from './babelPlugins/awaitImport/awaitImport';
|
|
5
4
|
import { DepBuilder } from './depBuilder/depBuilder';
|
|
6
5
|
import { DepInfo } from './depInfo';
|
|
@@ -36,7 +35,7 @@ export declare class MFSU {
|
|
|
36
35
|
buildDeps(): Promise<void>;
|
|
37
36
|
getMiddlewares(): ((req: Request, res: Response, next: NextFunction) => void)[];
|
|
38
37
|
private getAwaitImportCollectOpts;
|
|
39
|
-
getBabelPlugins(): (
|
|
38
|
+
getBabelPlugins(): ({
|
|
40
39
|
onTransformDeps: () => void;
|
|
41
40
|
onCollect: ({ file, data, }: {
|
|
42
41
|
file: string;
|
|
@@ -54,7 +53,7 @@ export declare class MFSU {
|
|
|
54
53
|
remoteName: string | undefined;
|
|
55
54
|
alias: Record<string, string>;
|
|
56
55
|
externals: (Function | Record<string, string>)[];
|
|
57
|
-
} | typeof awaitImport)[]
|
|
56
|
+
} | typeof awaitImport)[][];
|
|
58
57
|
getEsbuildLoaderHandler(): any[];
|
|
59
58
|
}
|
|
60
59
|
export {};
|
package/dist/mfsu.js
CHANGED
|
@@ -21,14 +21,12 @@ const path_1 = require("path");
|
|
|
21
21
|
const mrmime_1 = require("../compiled/mrmime");
|
|
22
22
|
// @ts-ignore
|
|
23
23
|
const webpack_virtual_modules_1 = __importDefault(require("../compiled/webpack-virtual-modules"));
|
|
24
|
-
const autoExport_1 = __importDefault(require("./babelPlugins/autoExport"));
|
|
25
24
|
const awaitImport_1 = __importDefault(require("./babelPlugins/awaitImport/awaitImport"));
|
|
26
25
|
const getRealPath_1 = require("./babelPlugins/awaitImport/getRealPath");
|
|
27
26
|
const constants_1 = require("./constants");
|
|
28
27
|
const dep_1 = require("./dep/dep");
|
|
29
28
|
const depBuilder_1 = require("./depBuilder/depBuilder");
|
|
30
29
|
const depInfo_1 = require("./depInfo");
|
|
31
|
-
const autoExport_2 = __importDefault(require("./esbuildHandlers/autoExport"));
|
|
32
30
|
const awaitImport_2 = __importDefault(require("./esbuildHandlers/awaitImport"));
|
|
33
31
|
const types_1 = require("./types");
|
|
34
32
|
const makeArray_1 = require("./utils/makeArray");
|
|
@@ -273,13 +271,12 @@ promise new Promise(resolve => {
|
|
|
273
271
|
};
|
|
274
272
|
}
|
|
275
273
|
getBabelPlugins() {
|
|
276
|
-
return [
|
|
274
|
+
return [[awaitImport_1.default, this.getAwaitImportCollectOpts()]];
|
|
277
275
|
}
|
|
278
276
|
getEsbuildLoaderHandler() {
|
|
279
277
|
const cache = new Map();
|
|
280
278
|
const checkOpts = this.getAwaitImportCollectOpts();
|
|
281
279
|
return [
|
|
282
|
-
autoExport_2.default,
|
|
283
280
|
(0, awaitImport_2.default)({
|
|
284
281
|
cache,
|
|
285
282
|
opts: checkOpts,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/mfsu",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-rc.10",
|
|
4
4
|
"description": "@umijs/mfsu",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi-next/tree/master/packages/mfsu#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi-next/issues",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"test": "jest -c ../../jest.turbo.config.ts"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@umijs/bundler-esbuild": "4.0.0-
|
|
26
|
-
"@umijs/bundler-utils": "4.0.0-
|
|
27
|
-
"@umijs/utils": "4.0.0-
|
|
25
|
+
"@umijs/bundler-esbuild": "4.0.0-rc.10",
|
|
26
|
+
"@umijs/bundler-utils": "4.0.0-rc.10",
|
|
27
|
+
"@umijs/utils": "4.0.0-rc.10",
|
|
28
28
|
"enhanced-resolve": "5.9.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const t = __importStar(require("@umijs/bundler-utils/compiled/babel/types"));
|
|
27
|
-
function default_1() {
|
|
28
|
-
return {
|
|
29
|
-
visitor: {
|
|
30
|
-
Program(path) {
|
|
31
|
-
let hasExport = false;
|
|
32
|
-
path.node.body.forEach((node) => {
|
|
33
|
-
if (
|
|
34
|
-
// esm
|
|
35
|
-
t.isExportNamedDeclaration(node) ||
|
|
36
|
-
t.isExportDefaultDeclaration(node) ||
|
|
37
|
-
t.isExportAllDeclaration(node) ||
|
|
38
|
-
// cjs
|
|
39
|
-
(t.isExpressionStatement(node) &&
|
|
40
|
-
t.isAssignmentExpression(node.expression) &&
|
|
41
|
-
t.isMemberExpression(node.expression.left) &&
|
|
42
|
-
// exports.xxx =
|
|
43
|
-
(t.isIdentifier(node.expression.left.object, {
|
|
44
|
-
name: 'exports',
|
|
45
|
-
}) ||
|
|
46
|
-
// module.exports =
|
|
47
|
-
(t.isIdentifier(node.expression.left.object, {
|
|
48
|
-
name: 'module',
|
|
49
|
-
}) &&
|
|
50
|
-
t.isIdentifier(node.expression.left.property, {
|
|
51
|
-
name: 'exports',
|
|
52
|
-
}))))) {
|
|
53
|
-
hasExport = true;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
if (!hasExport) {
|
|
57
|
-
path.node.body.push(t.exportNamedDeclaration(t.variableDeclaration('const', [
|
|
58
|
-
t.variableDeclarator(t.identifier('__mfsu'), t.numericLiteral(1)),
|
|
59
|
-
])));
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
exports.default = default_1;
|