21 lines
1.1 KiB
Markdown
21 lines
1.1 KiB
Markdown
---
|
|
description: Code that must ship as standalone JS (memona framed_find.js, brain stream-recovery.js) is written as .ts, compiled at build time, and its output gitignored
|
|
---
|
|
|
|
Some apps ship plain JavaScript that runs outside the main bundle: memona's
|
|
`framed_find.js` and brain's `stream-recovery.js`. Under the TS-only rule
|
|
([[ts-only-files-and-imports]]) they are handled like this (2026-10-16):
|
|
|
|
- The source is a `.ts` file, linted and type-checked like everything else.
|
|
- The `.js` is produced at build time by the existing build (a Vite input or
|
|
a build step in `vite.config.ts` or `scripts/`), never committed.
|
|
- The output path is gitignored and, if it lands in a linted folder, listed
|
|
in `lint.ignorePatterns`; never in `overrides`, never with disable comments.
|
|
- Whatever loads the file (Rust `include_str!`, a container `COPY`, an HTML
|
|
`<script>`) keeps the same path and name as before, so behavior is
|
|
unchanged. Builds that need the file must run the compile first; check
|
|
that the Containerfile and CI order the steps that way.
|
|
|
|
Don't commit a hand-maintained `.js` copy "for convenience", and don't turn
|
|
it into `.mjs` or `.cjs`.
|