@utoo/pack 0.0.1-alpha.40 → 0.0.1-alpha.41
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/cjs/dev.js +6 -1
- package/esm/dev.js +6 -1
- package/package.json +9 -9
package/cjs/dev.js
CHANGED
|
@@ -19,6 +19,7 @@ const net_1 = require("net");
|
|
|
19
19
|
const path_1 = __importDefault(require("path"));
|
|
20
20
|
const send_1 = __importDefault(require("send"));
|
|
21
21
|
const url_1 = __importDefault(require("url"));
|
|
22
|
+
const find_root_1 = require("./find-root");
|
|
22
23
|
const hmr_1 = require("./hmr");
|
|
23
24
|
const mkcert_1 = require("./mkcert");
|
|
24
25
|
const util_1 = require("./util");
|
|
@@ -28,6 +29,10 @@ function serve(options, projectPath, rootPath, serverOptions) {
|
|
|
28
29
|
const bundleOptions = options.compatMode
|
|
29
30
|
? (0, webpackCompat_1.compatOptionsFromWebpack)(options)
|
|
30
31
|
: options;
|
|
32
|
+
if (!rootPath) {
|
|
33
|
+
// help user to find the rootDir automatically
|
|
34
|
+
rootPath = (0, find_root_1.findRootDir)(projectPath || process.cwd());
|
|
35
|
+
}
|
|
31
36
|
return serveInternal(bundleOptions, projectPath, rootPath, serverOptions);
|
|
32
37
|
}
|
|
33
38
|
async function serveInternal(options, projectPath, rootPath, serverOptions) {
|
|
@@ -35,7 +40,7 @@ async function serveInternal(options, projectPath, rootPath, serverOptions) {
|
|
|
35
40
|
if (process.env.XCODE_PROFILE) {
|
|
36
41
|
await (0, xcodeProfile_1.xcodeProfilingReady)();
|
|
37
42
|
}
|
|
38
|
-
startServer({
|
|
43
|
+
await startServer({
|
|
39
44
|
hostname: (serverOptions === null || serverOptions === void 0 ? void 0 : serverOptions.hostname) || "localhost",
|
|
40
45
|
port: (serverOptions === null || serverOptions === void 0 ? void 0 : serverOptions.port) || 3000,
|
|
41
46
|
https: serverOptions === null || serverOptions === void 0 ? void 0 : serverOptions.https,
|
package/esm/dev.js
CHANGED
|
@@ -5,6 +5,7 @@ import { isIPv6 } from "net";
|
|
|
5
5
|
import path from "path";
|
|
6
6
|
import send from "send";
|
|
7
7
|
import url from "url";
|
|
8
|
+
import { findRootDir } from "./find-root";
|
|
8
9
|
import { createHotReloader } from "./hmr";
|
|
9
10
|
import { createSelfSignedCertificate } from "./mkcert";
|
|
10
11
|
import { blockStdout } from "./util";
|
|
@@ -14,6 +15,10 @@ export function serve(options, projectPath, rootPath, serverOptions) {
|
|
|
14
15
|
const bundleOptions = options.compatMode
|
|
15
16
|
? compatOptionsFromWebpack(options)
|
|
16
17
|
: options;
|
|
18
|
+
if (!rootPath) {
|
|
19
|
+
// help user to find the rootDir automatically
|
|
20
|
+
rootPath = findRootDir(projectPath || process.cwd());
|
|
21
|
+
}
|
|
17
22
|
return serveInternal(bundleOptions, projectPath, rootPath, serverOptions);
|
|
18
23
|
}
|
|
19
24
|
async function serveInternal(options, projectPath, rootPath, serverOptions) {
|
|
@@ -21,7 +26,7 @@ async function serveInternal(options, projectPath, rootPath, serverOptions) {
|
|
|
21
26
|
if (process.env.XCODE_PROFILE) {
|
|
22
27
|
await xcodeProfilingReady();
|
|
23
28
|
}
|
|
24
|
-
startServer({
|
|
29
|
+
await startServer({
|
|
25
30
|
hostname: (serverOptions === null || serverOptions === void 0 ? void 0 : serverOptions.hostname) || "localhost",
|
|
26
31
|
port: (serverOptions === null || serverOptions === void 0 ? void 0 : serverOptions.port) || 3000,
|
|
27
32
|
https: serverOptions === null || serverOptions === void 0 ? void 0 : serverOptions.https,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utoo/pack",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.41",
|
|
4
4
|
"main": "cjs/index.js",
|
|
5
5
|
"module": "esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@types/webpack": "^5.28.5"
|
|
71
71
|
},
|
|
72
72
|
"engines": {
|
|
73
|
-
"node": ">=
|
|
73
|
+
"node": ">= 20"
|
|
74
74
|
},
|
|
75
75
|
"scripts": {
|
|
76
76
|
"build:cjs": "rm -rf cjs && tsc -p ./tsconfig.json --module commonjs --outDir cjs && cp src/*.d.ts cjs/",
|
|
@@ -85,12 +85,12 @@
|
|
|
85
85
|
},
|
|
86
86
|
"repository": "git@github.com:umijs/mako.git",
|
|
87
87
|
"optionalDependencies": {
|
|
88
|
-
"@utoo/pack-darwin-arm64": "0.0.1-alpha.
|
|
89
|
-
"@utoo/pack-darwin-x64": "0.0.1-alpha.
|
|
90
|
-
"@utoo/pack-linux-arm64-gnu": "0.0.1-alpha.
|
|
91
|
-
"@utoo/pack-linux-arm64-musl": "0.0.1-alpha.
|
|
92
|
-
"@utoo/pack-linux-x64-gnu": "0.0.1-alpha.
|
|
93
|
-
"@utoo/pack-linux-x64-musl": "0.0.1-alpha.
|
|
94
|
-
"@utoo/pack-win32-x64-msvc": "0.0.1-alpha.
|
|
88
|
+
"@utoo/pack-darwin-arm64": "0.0.1-alpha.41",
|
|
89
|
+
"@utoo/pack-darwin-x64": "0.0.1-alpha.41",
|
|
90
|
+
"@utoo/pack-linux-arm64-gnu": "0.0.1-alpha.41",
|
|
91
|
+
"@utoo/pack-linux-arm64-musl": "0.0.1-alpha.41",
|
|
92
|
+
"@utoo/pack-linux-x64-gnu": "0.0.1-alpha.41",
|
|
93
|
+
"@utoo/pack-linux-x64-musl": "0.0.1-alpha.41",
|
|
94
|
+
"@utoo/pack-win32-x64-msvc": "0.0.1-alpha.41"
|
|
95
95
|
}
|
|
96
96
|
}
|