@t8/serve 0.1.21 → 0.1.23

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 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
@@ -37,7 +37,7 @@ npx @t8/serve 3000 app public dist -b src/index.ts
37
37
  - index.css
38
38
  - index.html
39
39
  contains <script src="/dist/index.js"></script>
40
- contains <link rel="stylesheet" href="/index.css"></script>
40
+ contains <link rel="stylesheet" href="/index.css">
41
41
  - index.ts
42
42
  ```
43
43
 
@@ -77,7 +77,7 @@ webServer: {
77
77
  - index.tsx // imports "./App.tsx", "./index.css"
78
78
  - index.html
79
79
  contains <script src="/dist/index.js"></script>
80
- contains <link rel="stylesheet" href="/dist/index.css"></script>
80
+ contains <link rel="stylesheet" href="/dist/index.css">
81
81
  ```
82
82
 
83
83
  ```sh
@@ -124,7 +124,7 @@ server.close();
124
124
  - index.css
125
125
  - index.html
126
126
  contains <script src="/dist/index.js"></script>
127
- contains <link rel="stylesheet" href="/index.css"></script>
127
+ contains <link rel="stylesheet" href="/index.css">
128
128
  - index.ts
129
129
  ```
130
130
 
@@ -160,7 +160,7 @@ test.afterAll(() => {
160
160
  - index.tsx // imports "./App.tsx", "./index.css"
161
161
  - index.html
162
162
  contains <script src="/dist/index.js"></script>
163
- contains <link rel="stylesheet" href="/dist/index.css"></script>
163
+ contains <link rel="stylesheet" href="/dist/index.css">
164
164
  - index.ts
165
165
  - index.test.ts
166
166
  ```
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t8/serve",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "description": "Simple static file server + bundler, primarily for demo apps and tests, manual or automated",
5
5
  "keywords": [
6
6
  "node",
@@ -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