umi 4.0.5 → 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/cli/dev.js CHANGED
@@ -1,26 +1,45 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
4
10
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.dev = void 0;
7
- const fork_1 = __importDefault(require("./fork"));
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ 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));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // dev.ts
23
+ var dev_exports = {};
24
+ __export(dev_exports, {
25
+ dev: () => dev
26
+ });
27
+ module.exports = __toCommonJS(dev_exports);
28
+ var import_fork = __toESM(require("./fork"));
8
29
  function dev() {
9
- const child = (0, fork_1.default)({
10
- scriptPath: require.resolve('../../bin/forkedDev'),
11
- });
12
- // ref:
13
- // http://nodejs.cn/api/process/signal_events.html
14
- // https://lisk.io/blog/development/why-we-stopped-using-npm-start-child-processes
15
- process.on('SIGINT', () => {
16
- child.kill('SIGINT');
17
- // ref:
18
- // https://github.com/umijs/umi/issues/6009
19
- process.exit(0);
20
- });
21
- process.on('SIGTERM', () => {
22
- child.kill('SIGTERM');
23
- process.exit(1);
24
- });
30
+ const child = (0, import_fork.default)({
31
+ scriptPath: require.resolve("../../bin/forkedDev")
32
+ });
33
+ process.on("SIGINT", () => {
34
+ child.kill("SIGINT");
35
+ process.exit(0);
36
+ });
37
+ process.on("SIGTERM", () => {
38
+ child.kill("SIGTERM");
39
+ process.exit(1);
40
+ });
25
41
  }
26
- exports.dev = dev;
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ dev
45
+ });
package/dist/cli/fork.js CHANGED
@@ -1,40 +1,62 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const child_process_1 = require("child_process");
4
- const usedPorts = [];
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
+ // fork.ts
20
+ var fork_exports = {};
21
+ __export(fork_exports, {
22
+ default: () => start
23
+ });
24
+ module.exports = __toCommonJS(fork_exports);
25
+ var import_child_process = require("child_process");
26
+ var usedPorts = [];
5
27
  function start({ scriptPath }) {
6
- const execArgv = process.execArgv.slice(0);
7
- const inspectArgvIndex = execArgv.findIndex((argv) => argv.includes('--inspect-brk'));
8
- if (inspectArgvIndex > -1) {
9
- const inspectArgv = execArgv[inspectArgvIndex];
10
- execArgv.splice(inspectArgvIndex, 1, inspectArgv.replace(/--inspect-brk=(.*)/, (_match, s1) => {
11
- let port;
12
- try {
13
- port = parseInt(s1) + 1;
14
- }
15
- catch (e) {
16
- port = 9230; // node default inspect port plus 1.
17
- }
18
- if (usedPorts.includes(port)) {
19
- port += 1;
20
- }
21
- usedPorts.push(port);
22
- return `--inspect-brk=${port}`;
23
- }));
28
+ const execArgv = process.execArgv.slice(0);
29
+ const inspectArgvIndex = execArgv.findIndex((argv) => argv.includes("--inspect-brk"));
30
+ if (inspectArgvIndex > -1) {
31
+ const inspectArgv = execArgv[inspectArgvIndex];
32
+ execArgv.splice(inspectArgvIndex, 1, inspectArgv.replace(/--inspect-brk=(.*)/, (_match, s1) => {
33
+ let port;
34
+ try {
35
+ port = parseInt(s1) + 1;
36
+ } catch (e) {
37
+ port = 9230;
38
+ }
39
+ if (usedPorts.includes(port)) {
40
+ port += 1;
41
+ }
42
+ usedPorts.push(port);
43
+ return `--inspect-brk=${port}`;
44
+ }));
45
+ }
46
+ const child = (0, import_child_process.fork)(scriptPath, process.argv.slice(2), { execArgv });
47
+ child.on("message", (data) => {
48
+ var _a;
49
+ const { type, payload } = data || {};
50
+ if (type === "RESTART") {
51
+ child.kill();
52
+ if (payload == null ? void 0 : payload.port) {
53
+ process.env.PORT = payload.port;
54
+ }
55
+ start({ scriptPath });
24
56
  }
25
- const child = (0, child_process_1.fork)(scriptPath, process.argv.slice(2), { execArgv });
26
- child.on('message', (data) => {
27
- var _a;
28
- const { type, payload } = data || {};
29
- if (type === 'RESTART') {
30
- child.kill();
31
- if (payload === null || payload === void 0 ? void 0 : payload.port) {
32
- process.env.PORT = payload.port;
33
- }
34
- start({ scriptPath });
35
- }
36
- (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, data);
37
- });
38
- return child;
57
+ (_a = process.send) == null ? void 0 : _a.call(process, data);
58
+ });
59
+ return child;
39
60
  }
40
- exports.default = start;
61
+ // Annotate the CommonJS export names for ESM import in node:
62
+ 0 && (module.exports = {});
@@ -1,44 +1,37 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("@umijs/utils");
4
- const constants_1 = require("../constants");
5
- const service_1 = require("../service/service");
6
- const node_1 = require("./node");
7
- const printHelp_1 = require("./printHelp");
8
- (0, node_1.setNodeTitle)(`${constants_1.FRAMEWORK_NAME}-dev`);
9
- (0, node_1.setNoDeprecation)();
1
+ // forkedDev.ts
2
+ var import_utils = require("@umijs/utils");
3
+ var import_constants = require("../constants");
4
+ var import_service = require("../service/service");
5
+ var import_node = require("./node");
6
+ (0, import_node.setNodeTitle)(`${import_constants.FRAMEWORK_NAME}-dev`);
7
+ (0, import_node.setNoDeprecation)();
10
8
  (async () => {
11
- try {
12
- const args = (0, utils_1.yParser)(process.argv.slice(2));
13
- const service = new service_1.Service();
14
- await service.run2({
15
- name: constants_1.DEV_COMMAND,
16
- args,
17
- });
18
- let closed = false;
19
- // kill(2) Ctrl-C
20
- process.once('SIGINT', () => onSignal('SIGINT'));
21
- // kill(3) Ctrl-\
22
- process.once('SIGQUIT', () => onSignal('SIGQUIT'));
23
- // kill(15) default
24
- process.once('SIGTERM', () => onSignal('SIGTERM'));
25
- function onSignal(signal) {
26
- if (closed)
27
- return;
28
- closed = true;
29
- // 退出时触发插件中的 onExit 事件
30
- service.applyPlugins({
31
- key: 'onExit',
32
- args: {
33
- signal,
34
- },
35
- });
36
- process.exit(0);
9
+ try {
10
+ let onSignal = function(signal) {
11
+ if (closed)
12
+ return;
13
+ closed = true;
14
+ service.applyPlugins({
15
+ key: "onExit",
16
+ args: {
17
+ signal
37
18
  }
38
- }
39
- catch (e) {
40
- utils_1.logger.fatal(e);
41
- (0, printHelp_1.printHelp)();
42
- process.exit(1);
43
- }
19
+ });
20
+ process.exit(0);
21
+ };
22
+ const args = (0, import_utils.yParser)(process.argv.slice(2));
23
+ const service = new import_service.Service();
24
+ await service.run2({
25
+ name: import_constants.DEV_COMMAND,
26
+ args
27
+ });
28
+ let closed = false;
29
+ process.once("SIGINT", () => onSignal("SIGINT"));
30
+ process.once("SIGQUIT", () => onSignal("SIGQUIT"));
31
+ process.once("SIGTERM", () => onSignal("SIGTERM"));
32
+ } catch (e) {
33
+ import_utils.logger.fatal(e);
34
+ import_utils.printHelp.exit();
35
+ process.exit(1);
36
+ }
44
37
  })();
package/dist/cli/node.js CHANGED
@@ -1,32 +1,56 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setNoDeprecation = exports.setNodeTitle = exports.checkLocal = exports.checkVersion = void 0;
4
- const utils_1 = require("@umijs/utils");
5
- const constants_1 = require("../constants");
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
+ // node.ts
20
+ var node_exports = {};
21
+ __export(node_exports, {
22
+ checkLocal: () => checkLocal,
23
+ checkVersion: () => checkVersion,
24
+ setNoDeprecation: () => setNoDeprecation,
25
+ setNodeTitle: () => setNodeTitle
26
+ });
27
+ module.exports = __toCommonJS(node_exports);
28
+ var import_utils = require("@umijs/utils");
29
+ var import_constants = require("../constants");
6
30
  function checkVersion() {
7
- const v = parseInt(process.version.slice(1));
8
- if (v < constants_1.MIN_NODE_VERSION || v === 15 || v === 17) {
9
- utils_1.logger.error(`Your node version ${v} is not supported, please upgrade to ${constants_1.MIN_NODE_VERSION} or above except 15 or 17.`);
10
- process.exit(1);
11
- }
31
+ const v = parseInt(process.version.slice(1));
32
+ if (v < import_constants.MIN_NODE_VERSION || v === 15 || v === 17) {
33
+ import_utils.logger.error(`Your node version ${v} is not supported, please upgrade to ${import_constants.MIN_NODE_VERSION} or above except 15 or 17.`);
34
+ process.exit(1);
35
+ }
12
36
  }
13
- exports.checkVersion = checkVersion;
14
37
  function checkLocal() {
15
- if ((0, utils_1.isLocalDev)()) {
16
- utils_1.logger.info('@local');
17
- }
38
+ if ((0, import_utils.isLocalDev)()) {
39
+ import_utils.logger.info("@local");
40
+ }
18
41
  }
19
- exports.checkLocal = checkLocal;
20
42
  function setNodeTitle(name) {
21
- if (process.title === 'node') {
22
- process.title = name || constants_1.FRAMEWORK_NAME;
23
- }
43
+ if (process.title === "node") {
44
+ process.title = name || import_constants.FRAMEWORK_NAME;
45
+ }
24
46
  }
25
- exports.setNodeTitle = setNodeTitle;
26
47
  function setNoDeprecation() {
27
- // Use magic to suppress node deprecation warnings
28
- // See: https://github.com/nodejs/node/blob/master/lib/internal/process/warning.js#L77
29
- // @ts-ignore
30
- process.noDeprecation = '1';
48
+ process.noDeprecation = "1";
31
49
  }
32
- exports.setNoDeprecation = setNoDeprecation;
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ checkLocal,
53
+ checkVersion,
54
+ setNoDeprecation,
55
+ setNodeTitle
56
+ });
package/dist/constants.js CHANGED
@@ -1,12 +1,43 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FRAMEWORK_NAME = exports.DEFAULT_CONFIG_FILES = exports.DEV_COMMAND = exports.MIN_NODE_VERSION = void 0;
4
- exports.MIN_NODE_VERSION = 14;
5
- exports.DEV_COMMAND = 'dev';
6
- exports.DEFAULT_CONFIG_FILES = [
7
- '.umirc.ts',
8
- '.umirc.js',
9
- 'config/config.ts',
10
- 'config/config.js',
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
+ // constants.ts
20
+ var constants_exports = {};
21
+ __export(constants_exports, {
22
+ DEFAULT_CONFIG_FILES: () => DEFAULT_CONFIG_FILES,
23
+ DEV_COMMAND: () => DEV_COMMAND,
24
+ FRAMEWORK_NAME: () => FRAMEWORK_NAME,
25
+ MIN_NODE_VERSION: () => MIN_NODE_VERSION
26
+ });
27
+ module.exports = __toCommonJS(constants_exports);
28
+ var MIN_NODE_VERSION = 14;
29
+ var DEV_COMMAND = "dev";
30
+ var DEFAULT_CONFIG_FILES = [
31
+ ".umirc.ts",
32
+ ".umirc.js",
33
+ "config/config.ts",
34
+ "config/config.js"
11
35
  ];
12
- exports.FRAMEWORK_NAME = 'umi';
36
+ var FRAMEWORK_NAME = "umi";
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ DEFAULT_CONFIG_FILES,
40
+ DEV_COMMAND,
41
+ FRAMEWORK_NAME,
42
+ MIN_NODE_VERSION
43
+ });
@@ -1,7 +1,31 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defineConfig = void 0;
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
+ // defineConfig.ts
20
+ var defineConfig_exports = {};
21
+ __export(defineConfig_exports, {
22
+ defineConfig: () => defineConfig
23
+ });
24
+ module.exports = __toCommonJS(defineConfig_exports);
4
25
  function defineConfig(config) {
5
- return config;
26
+ return config;
6
27
  }
7
- exports.defineConfig = defineConfig;
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ defineConfig
31
+ });
@@ -1,7 +1,31 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defineMock = void 0;
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
+ // defineMock.ts
20
+ var defineMock_exports = {};
21
+ __export(defineMock_exports, {
22
+ defineMock: () => defineMock
23
+ });
24
+ module.exports = __toCommonJS(defineMock_exports);
4
25
  function defineMock(mockData) {
5
- return mockData;
26
+ return mockData;
6
27
  }
7
- exports.defineMock = defineMock;
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ defineMock
31
+ });
package/dist/index.js CHANGED
@@ -1,24 +1,37 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
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 });
15
8
  };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.defineMock = exports.defineConfig = exports.run = void 0;
18
- var cli_1 = require("./cli/cli");
19
- Object.defineProperty(exports, "run", { enumerable: true, get: function () { return cli_1.run; } });
20
- var defineConfig_1 = require("./defineConfig");
21
- Object.defineProperty(exports, "defineConfig", { enumerable: true, get: function () { return defineConfig_1.defineConfig; } });
22
- var defineMock_1 = require("./defineMock");
23
- Object.defineProperty(exports, "defineMock", { enumerable: true, get: function () { return defineMock_1.defineMock; } });
24
- __exportStar(require("./service/service"), exports);
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ defineConfig: () => import_defineConfig.defineConfig,
24
+ defineMock: () => import_defineMock.defineMock,
25
+ run: () => import_cli.run
26
+ });
27
+ module.exports = __toCommonJS(src_exports);
28
+ var import_cli = require("./cli/cli");
29
+ var import_defineConfig = require("./defineConfig");
30
+ var import_defineMock = require("./defineMock");
31
+ __reExport(src_exports, require("./service/service"), module.exports);
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ defineConfig,
35
+ defineMock,
36
+ run
37
+ });
@@ -1,39 +1,40 @@
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
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
27
10
  };
28
- var __importDefault = (this && this.__importDefault) || function (mod) {
29
- return (mod && mod.__esModule) ? mod : { "default": mod };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
30
18
  };
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.express = exports.httpProxyMiddleware = exports.createServerRoutes = void 0;
33
- const express_1 = __importDefault(require("@umijs/bundler-utils/compiled/express"));
34
- exports.express = express_1.default;
35
- const httpProxyMiddleware = __importStar(require("@umijs/bundler-webpack/compiled/http-proxy-middleware"));
36
- exports.httpProxyMiddleware = httpProxyMiddleware;
37
- var server_1 = require("@umijs/server");
38
- Object.defineProperty(exports, "createServerRoutes", { enumerable: true, get: function () { return server_1.createServerRoutes; } });
39
- __exportStar(require("@umijs/utils"), exports);
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ 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));
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+
23
+ // pluginUtils.ts
24
+ var pluginUtils_exports = {};
25
+ __export(pluginUtils_exports, {
26
+ createServerRoutes: () => import_server.createServerRoutes,
27
+ express: () => import_express.default,
28
+ httpProxyMiddleware: () => httpProxyMiddleware
29
+ });
30
+ module.exports = __toCommonJS(pluginUtils_exports);
31
+ var import_express = __toESM(require("@umijs/bundler-utils/compiled/express"));
32
+ var httpProxyMiddleware = __toESM(require("@umijs/bundler-webpack/compiled/http-proxy-middleware"));
33
+ var import_server = require("@umijs/server");
34
+ __reExport(pluginUtils_exports, require("@umijs/utils"), module.exports);
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ createServerRoutes,
38
+ express,
39
+ httpProxyMiddleware
40
+ });
@@ -1,13 +1,37 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCwd = void 0;
4
- const path_1 = require("path");
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
+ // cwd.ts
20
+ var cwd_exports = {};
21
+ __export(cwd_exports, {
22
+ getCwd: () => getCwd
23
+ });
24
+ module.exports = __toCommonJS(cwd_exports);
25
+ var import_path = require("path");
5
26
  function getCwd() {
6
- const cwd = process.cwd();
7
- const appRoot = process.env.APP_ROOT;
8
- if (appRoot) {
9
- return (0, path_1.isAbsolute)(appRoot) ? appRoot : (0, path_1.join)(cwd, appRoot);
10
- }
11
- return cwd;
27
+ const cwd = process.cwd();
28
+ const appRoot = process.env.APP_ROOT;
29
+ if (appRoot) {
30
+ return (0, import_path.isAbsolute)(appRoot) ? appRoot : (0, import_path.join)(cwd, appRoot);
31
+ }
32
+ return cwd;
12
33
  }
13
- exports.getCwd = getCwd;
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ getCwd
37
+ });