@t8/serve 0.1.22 → 0.1.24
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/README.md +3 -3
- package/dist/run.cjs +3 -2
- package/dist/run.mjs +3 -2
- package/package.json +1 -1
- package/src/BundleConfig.ts +3 -3
- package/src/run.ts +3 -2
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Use cases:
|
|
|
9
9
|
## CLI
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npx @t8/serve [url|port] [*] [app_dir] [...assets_dirs] [-b [bundle_input_path] [bundle_output_path]]
|
|
12
|
+
npx @t8/serve [url|port] [*] [app_dir] [...assets_dirs] [-b [bundle_input_path] [bundle_output_path] [bundle_output_dir]]
|
|
13
13
|
# * = SPA mode: serve all unmatched paths as "/"
|
|
14
14
|
|
|
15
15
|
npx @t8/serve 3000 app
|
|
@@ -71,7 +71,7 @@ webServer: {
|
|
|
71
71
|
|
|
72
72
|
```
|
|
73
73
|
/playground
|
|
74
|
-
src
|
|
74
|
+
- src
|
|
75
75
|
- App.tsx
|
|
76
76
|
- index.css
|
|
77
77
|
- index.tsx // imports "./App.tsx", "./index.css"
|
|
@@ -155,7 +155,7 @@ test.afterAll(() => {
|
|
|
155
155
|
|
|
156
156
|
```
|
|
157
157
|
/tests/x
|
|
158
|
-
src
|
|
158
|
+
- src
|
|
159
159
|
- index.css
|
|
160
160
|
- index.tsx // imports "./App.tsx", "./index.css"
|
|
161
161
|
- index.html
|
package/dist/run.cjs
CHANGED
|
@@ -132,8 +132,9 @@ async function run() {
|
|
|
132
132
|
else {
|
|
133
133
|
dirs = args.slice(1, bundleFlagIndex);
|
|
134
134
|
bundle2 = {
|
|
135
|
-
input: args[bundleFlagIndex + 1],
|
|
136
|
-
output: args[bundleFlagIndex + 2]
|
|
135
|
+
input: args[bundleFlagIndex + 1] || void 0,
|
|
136
|
+
output: args[bundleFlagIndex + 2] || void 0,
|
|
137
|
+
dir: args[bundleFlagIndex + 3] || void 0
|
|
137
138
|
};
|
|
138
139
|
}
|
|
139
140
|
await serve({
|
package/dist/run.mjs
CHANGED
|
@@ -131,8 +131,9 @@ async function run() {
|
|
|
131
131
|
else {
|
|
132
132
|
dirs = args.slice(1, bundleFlagIndex);
|
|
133
133
|
bundle2 = {
|
|
134
|
-
input: args[bundleFlagIndex + 1],
|
|
135
|
-
output: args[bundleFlagIndex + 2]
|
|
134
|
+
input: args[bundleFlagIndex + 1] || void 0,
|
|
135
|
+
output: args[bundleFlagIndex + 2] || void 0,
|
|
136
|
+
dir: args[bundleFlagIndex + 3] || void 0
|
|
136
137
|
};
|
|
137
138
|
}
|
|
138
139
|
await serve({
|
package/package.json
CHANGED
package/src/BundleConfig.ts
CHANGED
|
@@ -4,17 +4,17 @@ export type BundleConfig = {
|
|
|
4
4
|
*
|
|
5
5
|
* @defaultValue "dist"
|
|
6
6
|
*/
|
|
7
|
-
dir?: string;
|
|
7
|
+
dir?: string | undefined;
|
|
8
8
|
/**
|
|
9
9
|
* Input path relative to the server config `path`.
|
|
10
10
|
*
|
|
11
11
|
* @defaultValue "index.ts"
|
|
12
12
|
*/
|
|
13
|
-
input?: string;
|
|
13
|
+
input?: string | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* Output path relative to the bundle config `dir`.
|
|
16
16
|
*
|
|
17
17
|
* @defaultValue "index.js"
|
|
18
18
|
*/
|
|
19
|
-
output?: string;
|
|
19
|
+
output?: string | undefined;
|
|
20
20
|
};
|
package/src/run.ts
CHANGED
|
@@ -21,8 +21,9 @@ async function run() {
|
|
|
21
21
|
else {
|
|
22
22
|
dirs = args.slice(1, bundleFlagIndex);
|
|
23
23
|
bundle = {
|
|
24
|
-
input: args[bundleFlagIndex + 1],
|
|
25
|
-
output: args[bundleFlagIndex + 2],
|
|
24
|
+
input: args[bundleFlagIndex + 1] || undefined,
|
|
25
|
+
output: args[bundleFlagIndex + 2] || undefined,
|
|
26
|
+
dir: args[bundleFlagIndex + 3] || undefined,
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
|