@t8/serve 0.1.17 → 0.1.18

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/index.js CHANGED
@@ -11,7 +11,13 @@ import { promisify } from "node:util";
11
11
  var exec = promisify(originalExec);
12
12
  async function bundle({ path = "", bundle: options } = {}) {
13
13
  if (!options) return;
14
- let normalizedOptions = typeof options === "boolean" ? {} : options;
14
+ let normalizedOptions;
15
+ if (typeof options === "boolean") normalizedOptions = {};
16
+ else if (typeof options === "string")
17
+ normalizedOptions = {
18
+ input: options
19
+ };
20
+ else normalizedOptions = options;
15
21
  let inputFile = join(path, normalizedOptions.input ?? "index.ts");
16
22
  let outputFile = join(path, "dist", normalizedOptions.output ?? "index.js");
17
23
  await rm(join(path, "dist"), { recursive: true, force: true });
package/dist/run.cjs CHANGED
@@ -14,7 +14,13 @@ var import_node_util = require("node:util");
14
14
  var exec = (0, import_node_util.promisify)(import_node_child_process.exec);
15
15
  async function bundle({ path = "", bundle: options } = {}) {
16
16
  if (!options) return;
17
- let normalizedOptions = typeof options === "boolean" ? {} : options;
17
+ let normalizedOptions;
18
+ if (typeof options === "boolean") normalizedOptions = {};
19
+ else if (typeof options === "string")
20
+ normalizedOptions = {
21
+ input: options
22
+ };
23
+ else normalizedOptions = options;
18
24
  let inputFile = (0, import_node_path.join)(path, normalizedOptions.input ?? "index.ts");
19
25
  let outputFile = (0, import_node_path.join)(path, "dist", normalizedOptions.output ?? "index.js");
20
26
  await (0, import_promises.rm)((0, import_node_path.join)(path, "dist"), { recursive: true, force: true });
package/dist/run.mjs CHANGED
@@ -13,7 +13,13 @@ import { promisify } from "node:util";
13
13
  var exec = promisify(originalExec);
14
14
  async function bundle({ path = "", bundle: options } = {}) {
15
15
  if (!options) return;
16
- let normalizedOptions = typeof options === "boolean" ? {} : options;
16
+ let normalizedOptions;
17
+ if (typeof options === "boolean") normalizedOptions = {};
18
+ else if (typeof options === "string")
19
+ normalizedOptions = {
20
+ input: options
21
+ };
22
+ else normalizedOptions = options;
17
23
  let inputFile = join(path, normalizedOptions.input ?? "index.ts");
18
24
  let outputFile = join(path, "dist", normalizedOptions.output ?? "index.js");
19
25
  await rm(join(path, "dist"), { recursive: true, force: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t8/serve",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "node",
package/src/Config.ts CHANGED
@@ -8,5 +8,5 @@ export type Config = {
8
8
  dirs?: string[];
9
9
  spa?: boolean;
10
10
  log?: boolean;
11
- bundle?: boolean | BundleConfig;
11
+ bundle?: boolean | string | BundleConfig;
12
12
  };
package/src/bundle.ts CHANGED
@@ -10,8 +10,14 @@ const exec = promisify(originalExec);
10
10
  export async function bundle({ path = "", bundle: options }: Config = {}) {
11
11
  if (!options) return;
12
12
 
13
- let normalizedOptions: BundleConfig =
14
- typeof options === "boolean" ? {} : options;
13
+ let normalizedOptions: BundleConfig;
14
+
15
+ if (typeof options === "boolean") normalizedOptions = {};
16
+ else if (typeof options === "string")
17
+ normalizedOptions = {
18
+ input: options,
19
+ };
20
+ else normalizedOptions = options;
15
21
 
16
22
  let inputFile = join(path, normalizedOptions.input ?? "index.ts");
17
23
  let outputFile = join(path, "dist", normalizedOptions.output ?? "index.js");