@t8/serve 0.2.0 → 0.2.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/README.md +4 -7
- package/dist/index.d.ts +6 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ Use cases:
|
|
|
12
12
|
```
|
|
13
13
|
npx @t8/serve <app_dir> [...optional flags]
|
|
14
14
|
|
|
15
|
-
Flag Usage
|
|
15
|
+
Flag Usage notes
|
|
16
16
|
|
|
17
17
|
--bundle, -b -b [input_path [[output_path] [output_dir]]]
|
|
18
18
|
Defaults:
|
|
@@ -23,18 +23,15 @@ Flag Usage
|
|
|
23
23
|
--url, -u -u [<host>:]<port>
|
|
24
24
|
Default: "localhost:3000"
|
|
25
25
|
|
|
26
|
-
--spa, -s
|
|
27
|
-
Enables the SPA mode by handling all unmatched paths as "/".
|
|
26
|
+
--spa, -s To switch to the SPA mode by handling all unmatched paths as "/".
|
|
28
27
|
|
|
29
28
|
--dirs --dirs assets public
|
|
30
29
|
To serve files from the listed subdirectories of <app_dir>.
|
|
31
30
|
By default, files are served from <app_dir>.
|
|
32
31
|
|
|
33
|
-
--watch
|
|
34
|
-
To rebuild the bundled code if the source code changes.
|
|
32
|
+
--watch To rebuild the bundled code if the source code changes.
|
|
35
33
|
|
|
36
|
-
--minify
|
|
37
|
-
To minify the bundled code.
|
|
34
|
+
--minify To minify the bundled code.
|
|
38
35
|
```
|
|
39
36
|
|
|
40
37
|
<details>
|
package/dist/index.d.ts
CHANGED
|
@@ -22,8 +22,7 @@ type BundleConfig = {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
type Config = {
|
|
25
|
-
/** Server URL. */
|
|
26
|
-
url?: string;
|
|
25
|
+
/** Server URL. */url?: string;
|
|
27
26
|
/**
|
|
28
27
|
* Server host.
|
|
29
28
|
*
|
|
@@ -35,8 +34,7 @@ type Config = {
|
|
|
35
34
|
*
|
|
36
35
|
* @defaultValue 3000
|
|
37
36
|
*/
|
|
38
|
-
port?: number;
|
|
39
|
-
/** Application path. */
|
|
37
|
+
port?: number; /** Application path. */
|
|
40
38
|
path?: string;
|
|
41
39
|
/**
|
|
42
40
|
* Public assets directories. If not provided, the application
|
|
@@ -47,12 +45,9 @@ type Config = {
|
|
|
47
45
|
* Enables single-page application (SPA) mode. If `true`, all
|
|
48
46
|
* unmatched URLs are served as "/".
|
|
49
47
|
*/
|
|
50
|
-
spa?: boolean;
|
|
51
|
-
/** Whether
|
|
52
|
-
|
|
53
|
-
/** Whether the bundle should be minified. */
|
|
54
|
-
minify?: boolean;
|
|
55
|
-
/** Whether to log to the console. */
|
|
48
|
+
spa?: boolean; /** Whether to rebuild whenever the bundled files change. */
|
|
49
|
+
watch?: boolean; /** Whether the bundle should be minified. */
|
|
50
|
+
minify?: boolean; /** Whether to log to the console. */
|
|
56
51
|
log?: boolean;
|
|
57
52
|
/**
|
|
58
53
|
* Bundle config.
|
|
@@ -62,8 +57,7 @@ type Config = {
|
|
|
62
57
|
* If `true`, it's equivalent to `{ input: "index.ts", output: "index.js" }`.
|
|
63
58
|
* If `string`, it's equivalent to `input` in `{ input, ouput: "index.js" }`.
|
|
64
59
|
*/
|
|
65
|
-
bundle?: boolean | string | BundleConfig | undefined;
|
|
66
|
-
/** Custom request handler. */
|
|
60
|
+
bundle?: boolean | string | BundleConfig | undefined; /** Custom request handler. */
|
|
67
61
|
onRequest?: (req?: IncomingMessage, res?: ServerResponse<IncomingMessage>) => void | Promise<void>;
|
|
68
62
|
};
|
|
69
63
|
|