nscout 0.1.2 → 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/.env ADDED
@@ -0,0 +1,71 @@
1
+ # nscout configuration
2
+ # Copy or rename this file to .env before running nscout.
3
+ # All values shown are the defaults. Edit only what you need to change.
4
+
5
+ # ─── Registries ───────────────────────────────────────────────────────────────
6
+
7
+ # Comma-separated list of registries to check by default.
8
+ # Available: npm, github, pypi, domains, dockerhub
9
+ NSCOUT_REGISTRIES=npm,github,pypi,domains,dockerhub
10
+
11
+ # Comma-separated list of TLDs to check when domains registry is enabled.
12
+ NSCOUT_DOMAINS=.com,.dev,.io,.sh
13
+
14
+ # ─── Performance ──────────────────────────────────────────────────────────────
15
+
16
+ # Number of names checked in parallel.
17
+ NSCOUT_CONCURRENCY=4
18
+
19
+ # Per-request timeout in milliseconds.
20
+ NSCOUT_TIMEOUT=8000
21
+
22
+ # ─── AI suggest ───────────────────────────────────────────────────────────────
23
+
24
+ # Number of name candidates to generate with --suggest.
25
+ NSCOUT_LIMIT=10
26
+
27
+ # Default naming style for --suggest: free | claw | short | portmanteau
28
+ NSCOUT_STYLE=free
29
+
30
+ # Maximum tokens returned by the AI provider for --suggest.
31
+ NSCOUT_AI_MAX_TOKENS=512
32
+
33
+ # Force a specific AI provider: openai, anthropic
34
+ # If not set, the first provider with a valid API key is used automatically.
35
+ # Without any key, --suggest falls back to a deterministic stub and warns to stderr.
36
+ NSCOUT_AI_PROVIDER=
37
+
38
+ # OpenAI
39
+ OPENAI_API_KEY=
40
+ OPENAI_MODEL=gpt-4.1-mini
41
+
42
+ # Anthropic
43
+ ANTHROPIC_API_KEY=
44
+ ANTHROPIC_MODEL=claude-haiku-4-5-20251001
45
+
46
+ # ─── GitHub ───────────────────────────────────────────────────────────────────
47
+
48
+ # Without a token: 60 requests/hour (unauthenticated).
49
+ # With a token: 5000 requests/hour.
50
+ GITHUB_TOKEN=
51
+
52
+ # ─── RDAP (domain checks) ─────────────────────────────────────────────────────
53
+
54
+ # Number of retry attempts on non-404 RDAP errors (e.g. rate limiting).
55
+ NSCOUT_RDAP_RETRY_COUNT=1
56
+
57
+ # Delay in milliseconds between RDAP retry attempts.
58
+ NSCOUT_RDAP_RETRY_DELAY_MS=600
59
+
60
+ # Domains expiring within this many days are shown as expiring rather than taken.
61
+ NSCOUT_EXPIRING_THRESHOLD_DAYS=30
62
+
63
+ # ─── nscout-ui ────────────────────────────────────────────────────────────────
64
+
65
+ # Port for the nscout-ui web server.
66
+ PORT=3000
67
+
68
+ # Path to the nscout binary. Defaults to "nscout" (must be in PATH).
69
+ # If nscout is not globally installed, set the full path:
70
+ # NSCOUT_BIN=/path/to/nscout/dist/cli/index.js
71
+ NSCOUT_BIN=node ../dist/cli/index.js
package/.env.example CHANGED
@@ -5,8 +5,8 @@
5
5
  # ─── Registries ───────────────────────────────────────────────────────────────
6
6
 
7
7
  # Comma-separated list of registries to check by default.
8
- # Available: npm, github, pypi, domains
9
- NSCOUT_REGISTRIES=npm,github,pypi,domains
8
+ # Available: npm, github, pypi, domains, dockerhub
9
+ NSCOUT_REGISTRIES=npm,github,pypi,domains,dockerhub
10
10
 
11
11
  # Comma-separated list of TLDs to check when domains registry is enabled.
12
12
  NSCOUT_DOMAINS=.com,.dev,.io,.sh
@@ -59,3 +59,13 @@ NSCOUT_RDAP_RETRY_DELAY_MS=600
59
59
 
60
60
  # Domains expiring within this many days are shown as expiring rather than taken.
61
61
  NSCOUT_EXPIRING_THRESHOLD_DAYS=30
62
+
63
+ # ─── nscout-ui ────────────────────────────────────────────────────────────────
64
+
65
+ # Port for the nscout-ui web server.
66
+ PORT=3000
67
+
68
+ # Path to the nscout binary. Defaults to "nscout" (must be in PATH).
69
+ # If nscout is not globally installed, use the local build:
70
+ # NSCOUT_BIN=node ../dist/cli/index.js
71
+ NSCOUT_BIN=nscout
package/README.md CHANGED
@@ -131,6 +131,7 @@ Pass `-v` to show error details and expiry dates below the table.
131
131
  - **npm**: exact package match on the public registry
132
132
  - **GitHub**: checks both user and organization namespaces at `github.com/{name}` — taken if either exists
133
133
  - **PyPI**: exact package match
134
+ - **Docker Hub**: checks official library namespace at `hub.docker.com/r/library/{name}`
134
135
  - **Domains via RDAP**: `.com`, `.dev`, `.io`, `.sh` by default
135
136
 
136
137
  All checks run in parallel per name. Names run with bounded concurrency. RDAP
@@ -157,7 +158,7 @@ All configuration is through environment variables in `.env`. Copy `.env.example
157
158
 
158
159
  | Variable | Default | What it does |
159
160
  |---|---|---|
160
- | `NSCOUT_REGISTRIES` | `npm,github,pypi,domains` | Registries to check by default |
161
+ | `NSCOUT_REGISTRIES` | `npm,github,pypi,domains,dockerhub` | Registries to check by default |
161
162
  | `NSCOUT_DOMAINS` | `.com,.dev,.io,.sh` | TLDs to check when domains registry is enabled |
162
163
 
163
164
  ### Performance
@@ -194,6 +195,41 @@ All configuration is through environment variables in `.env`. Copy `.env.example
194
195
  | `NSCOUT_RDAP_RETRY_DELAY_MS` | `600` | Delay in milliseconds between RDAP retries |
195
196
  | `NSCOUT_EXPIRING_THRESHOLD_DAYS` | `30` | Domains expiring within this many days show as expiring |
196
197
 
198
+ ### Web UI
199
+
200
+ | Variable | Default | What it does |
201
+ |---|---|---|
202
+ | `PORT` | `3000` | Port for the nscout-ui web server |
203
+ | `NSCOUT_BIN` | `nscout` | Path to the nscout binary. Use `node ../dist/cli/index.js` if not installed globally |
204
+
205
+ ## Web UI
206
+
207
+ nscout includes a web interface in the `ui/` folder. It calls the nscout CLI and displays results in the browser.
208
+
209
+ ### Requirements
210
+
211
+ - nscout built or installed globally
212
+ - `.env` configured (same file as CLI)
213
+
214
+ ### Start
215
+
216
+ ```bash
217
+ cd ui
218
+ pnpm install
219
+ pnpm build
220
+ pnpm tsx server.ts
221
+ ```
222
+
223
+ Open `http://localhost:3000`.
224
+
225
+ In development (live reload):
226
+
227
+ ```bash
228
+ pnpm dev
229
+ ```
230
+
231
+ The UI runs on the port set in `PORT` (default 3000). The server spawns `nscout --json` and returns results to the browser.
232
+
197
233
  ## Architecture
198
234
 
199
235
  nscout is built as a set of independent modules with no coupling between layers.
@@ -240,12 +276,9 @@ focused, and the AI suggest mode is the headline that differentiates it.
240
276
 
241
277
  ## Roadmap
242
278
 
243
- - [ ] Optional: route `src/ai/suggest.ts` through **psclawmcp** instead of direct provider calls.
244
- - [ ] Docker Hub check (`hub.docker.com/v2/repositories/library/{name}`).
279
+ - [x] Docker Hub check.
245
280
  - [ ] VS Code Marketplace check.
246
- - [ ] Homebrew tap availability.
247
- - [ ] Premium-domain detection (would need a paid API like Domainr).
248
- - [ ] Watch mode: poll an expiring domain until it frees up.
281
+
249
282
 
250
283
  ## OpenClaw
251
284
 
@@ -258,7 +291,7 @@ The `--json` output makes nscout agent-friendly: structured results that any
258
291
  agent or script can parse and act on.
259
292
 
260
293
  To use `--suggest` through your OpenClaw agent's configured LLM instead of a
261
- separate API key, see the `psclawmcp` roadmap item above.
294
+ separate API key, configure `NSCOUT_AI_PROVIDER` in your `.env`.
262
295
 
263
296
  ## License
264
297
 
@@ -17,6 +17,7 @@ export declare const REGISTRY_URLS: {
17
17
  readonly githubOrgs: "https://api.github.com/orgs";
18
18
  readonly pypi: "https://pypi.org/pypi";
19
19
  readonly rdap: "https://rdap.org/domain";
20
+ readonly dockerHub: "https://hub.docker.com/v2/repositories/library";
20
21
  };
21
22
  export declare const GITHUB_HEADERS: {
22
23
  readonly accept: "application/vnd.github+json";
@@ -1,6 +1,6 @@
1
1
  import "dotenv/config";
2
2
  export const DEFAULTS = {
3
- registries: (process.env.NSCOUT_REGISTRIES || "npm,github,pypi,domains").split(","),
3
+ registries: (process.env.NSCOUT_REGISTRIES || "npm,github,pypi,domains,dockerhub").split(","),
4
4
  domains: (process.env.NSCOUT_DOMAINS || ".com,.dev,.io,.sh").split(","),
5
5
  concurrency: Number(process.env.NSCOUT_CONCURRENCY || 4),
6
6
  timeout: Number(process.env.NSCOUT_TIMEOUT || 8_000),
@@ -17,6 +17,7 @@ export const REGISTRY_URLS = {
17
17
  githubOrgs: "https://api.github.com/orgs",
18
18
  pypi: "https://pypi.org/pypi",
19
19
  rdap: "https://rdap.org/domain",
20
+ dockerHub: "https://hub.docker.com/v2/repositories/library",
20
21
  };
21
22
  export const GITHUB_HEADERS = {
22
23
  accept: "application/vnd.github+json",
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAEvB,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,UAAU,EAAa,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAe,yBAAyB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;IACzG,OAAO,EAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAkB,mBAAmB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;IACnG,WAAW,EAAY,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAe,CAAC,CAAC;IAC7E,OAAO,EAAgB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAmB,KAAK,CAAC;IACjF,KAAK,EAAkB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,IAAqB,EAAE,CAAC;IAC9E,KAAK,EAAkB,OAAO,CAAC,GAAG,CAAC,YAAY,IAA4B,MAAM;IACjF,qBAAqB,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,IAAI,EAAE,CAAC;IAC/E,gBAAgB,EAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,IAAO,GAAG,CAAC;IAC/E,cAAc,EAAS,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAW,CAAC,CAAC;IAC9E,WAAW,EAAY,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAc,GAAG,CAAC;CACjF,CAAC;AAEF,MAAM,CAAC,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,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAE/F,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,SAAS,EAAE,GAAG;IACd,KAAK,EAAM,GAAG;IACd,QAAQ,EAAG,GAAG;IACd,QAAQ,EAAG,GAAG;IACd,OAAO,EAAI,GAAG;IACd,KAAK,EAAM,GAAG;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GACvB,+EAA+E,CAAC;AAElF,MAAM,CAAC,MAAM,GAAG,GAAG;IACjB,EAAE,EAAE;QACF,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,IAAI;KACjD;IACD,MAAM,EAAE;QACN,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE;QACxC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,cAAc;KAClD;IACD,SAAS,EAAE;QACT,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,EAAE;QAC3C,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,2BAA2B;KAClE;IACD,MAAM,EAAE;QACN,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE;KACtC;CACF,CAAC"}
@@ -2,10 +2,12 @@ import { npmAdapter } from "./npm.js";
2
2
  import { githubAdapter } from "./github.js";
3
3
  import { pypiAdapter } from "./pypi.js";
4
4
  import { rdapAdapter } from "./rdap.js";
5
+ import { dockerHubAdapter } from "./dockerhub.js";
5
6
  export const ADAPTERS = new Map([
6
7
  ["npm", npmAdapter],
7
8
  ["github", githubAdapter],
8
9
  ["pypi", pypiAdapter],
9
10
  ["domains", rdapAdapter],
11
+ ["dockerhub", dockerHubAdapter],
10
12
  ]);
11
13
  //# sourceMappingURL=adapters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"adapters.js","sourceRoot":"","sources":["../../src/registries/adapters.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAA0B;IACvD,CAAC,KAAK,EAAM,UAAU,CAAC;IACvB,CAAC,QAAQ,EAAG,aAAa,CAAC;IAC1B,CAAC,MAAM,EAAK,WAAW,CAAC;IACxB,CAAC,SAAS,EAAE,WAAW,CAAC;CACzB,CAAC,CAAC"}
1
+ {"version":3,"file":"adapters.js","sourceRoot":"","sources":["../../src/registries/adapters.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAA0B;IACvD,CAAC,KAAK,EAAQ,UAAU,CAAC;IACzB,CAAC,QAAQ,EAAK,aAAa,CAAC;IAC5B,CAAC,MAAM,EAAO,WAAW,CAAC;IAC1B,CAAC,SAAS,EAAI,WAAW,CAAC;IAC1B,CAAC,WAAW,EAAE,gBAAgB,CAAC;CAChC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { RegistryAdapter } from "../types.js";
2
+ export declare const dockerHubAdapter: RegistryAdapter;
@@ -0,0 +1,20 @@
1
+ import { REGISTRY_URLS } from "../config/defaults.js";
2
+ export const dockerHubAdapter = {
3
+ name: "dockerhub",
4
+ async check(name, options) {
5
+ try {
6
+ const res = await fetch(`${REGISTRY_URLS.dockerHub}/${encodeURIComponent(name)}`, {
7
+ signal: AbortSignal.timeout(options.timeout),
8
+ });
9
+ if (res.status === 200)
10
+ return [{ registry: "dockerhub", status: "taken" }];
11
+ if (res.status === 404)
12
+ return [{ registry: "dockerhub", status: "available" }];
13
+ return [{ registry: "dockerhub", status: "unknown", detail: `HTTP ${res.status}` }];
14
+ }
15
+ catch (err) {
16
+ return [{ registry: "dockerhub", status: "error", detail: err instanceof Error ? err.message : String(err) }];
17
+ }
18
+ },
19
+ };
20
+ //# sourceMappingURL=dockerhub.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dockerhub.js","sourceRoot":"","sources":["../../src/registries/dockerhub.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,CAAC,MAAM,gBAAgB,GAAoB;IAC/C,IAAI,EAAE,WAAW;IACjB,KAAK,CAAC,KAAK,CAAC,IAAY,EAAE,OAAmB;QAC3C,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,aAAa,CAAC,SAAS,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE;gBAChF,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;aAC7C,CAAC,CAAC;YACH,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG;gBAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;YAC5E,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG;gBAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;YAChF,OAAO,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACtF,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChH,CAAC;IACH,CAAC;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nscout",
3
- "version": "0.1.2",
3
+ "version": "0.2.1",
4
4
  "description": "Scout a name across npm, GitHub, PyPI, and domain registries",
5
5
  "type": "module",
6
6
  "bin": {
package/ui/index.html ADDED
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>nscout</title>
7
+ </head>
8
+ <body>
9
+ <div id="app"></div>
10
+ <script type="module" src="/src/main.ts"></script>
11
+ </body>
12
+ </html>
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "nscout-ui",
3
+ "version": "0.1.0",
4
+ "description": "Web UI for nscout",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "concurrently \"tsx server.ts\" \"vite\"",
8
+ "dev:server": "tsx server.ts",
9
+ "dev:app": "vite",
10
+ "build": "vite build",
11
+ "start": "tsx server.ts"
12
+ },
13
+ "dependencies": {
14
+ "@hono/node-server": "^2.0.4",
15
+ "dotenv": "^17.4.2",
16
+ "hono": "^4.12.23"
17
+ },
18
+ "devDependencies": {
19
+ "@types/node": "^25.9.1",
20
+ "@vitejs/plugin-vue": "^6.0.7",
21
+ "concurrently": "^10.0.0",
22
+ "tsx": "^4.22.3",
23
+ "typescript": "^6.0.3",
24
+ "vite": "^8.0.14",
25
+ "vue": "^3.5.35"
26
+ }
27
+ }
package/ui/server.ts ADDED
@@ -0,0 +1,53 @@
1
+ import { config } from "dotenv";
2
+ import { resolve, dirname } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+
5
+ const __dirname = dirname(fileURLToPath(import.meta.url));
6
+ config({ path: resolve(__dirname, "../.env") });
7
+ import { execFile } from "node:child_process";
8
+ import { Hono } from "hono";
9
+ import { serve } from "@hono/node-server";
10
+ import { serveStatic } from "@hono/node-server/serve-static";
11
+
12
+ const app = new Hono();
13
+ const PORT = Number(process.env.PORT || 3000);
14
+ const NSCOUT_BIN = (process.env.NSCOUT_BIN || "nscout").split(" ");
15
+ const [bin, ...binArgs] = NSCOUT_BIN;
16
+
17
+ function runNscout(args: string[]): Promise<string> {
18
+ return new Promise((resolve, reject) => {
19
+ execFile(bin, [...binArgs, ...args], { env: { ...process.env } }, (err, stdout, stderr) => {
20
+ if (err) reject(new Error(stderr || err.message));
21
+ else resolve(stdout);
22
+ });
23
+ });
24
+ }
25
+
26
+ app.post("/api/check", async (c) => {
27
+ const { names, registries, domains } = await c.req.json<{
28
+ names: string[];
29
+ registries: string[];
30
+ domains: string[];
31
+ }>();
32
+
33
+ const args = [
34
+ ...names,
35
+ "--json",
36
+ "--no-color",
37
+ "-r", registries.join(","),
38
+ "-d", domains.join(","),
39
+ ];
40
+
41
+ try {
42
+ const stdout = await runNscout(args);
43
+ return c.json(JSON.parse(stdout));
44
+ } catch (err) {
45
+ return c.json({ error: err instanceof Error ? err.message : String(err) }, 500);
46
+ }
47
+ });
48
+
49
+ app.use("/*", serveStatic({ root: "./dist/app" }));
50
+
51
+ serve({ fetch: app.fetch, port: PORT }, () => {
52
+ process.stdout.write(`nscout-ui running at http://localhost:${PORT}\n`);
53
+ });
@@ -0,0 +1,14 @@
1
+ import { defineConfig } from "vite";
2
+ import vue from "@vitejs/plugin-vue";
3
+
4
+ export default defineConfig({
5
+ plugins: [vue()],
6
+ server: {
7
+ proxy: {
8
+ "/api": "http://localhost:3000",
9
+ },
10
+ },
11
+ build: {
12
+ outDir: "dist/app",
13
+ },
14
+ });