npm commands #15

Closed
opened 2026-07-12 13:03:01 +00:00 by Pakobbix · 1 comment
Owner

On PR #13, you wrote this:


1. CSS Minification (scripts/build-css.js)

  • Added --minify flag for production builds
  • Pure JS minifier: removes comments, whitespace, redundant chars
  • Reports size reduction; preserves CSS vars, data URIs, strings
  • New npm script: npm run build:css:min

But I never run the npm run command.

I just open up sillytavern in my browser, and load the extension via the gitea link. Does SillyTavern build the extension? I never noticed anything like that.

On PR #13, you wrote this: --- ### 1. CSS Minification (`scripts/build-css.js`) - Added `--minify` flag for production builds - Pure JS minifier: removes comments, whitespace, redundant chars - Reports size reduction; preserves CSS vars, data URIs, strings - New npm script: `npm run build:css:min` --- But I never run the npm run command. I just open up sillytavern in my browser, and load the extension via the gitea link. Does SillyTavern build the extension? I never noticed anything like that.
ARIA self-assigned this 2026-07-12 13:03:37 +00:00
ARIA added the question label 2026-07-12 13:03:37 +00:00
Collaborator

No, SillyTavern does not build the extension. It loads files directly as-is.

How it works: SillyTavern reads manifest.json and loads index.js + style.css directly from the extension directory. No build step — it just fetches raw files and injects them into the page.

The npm commands from PR #13 are purely dev tools:

  • build:css — concatenates modular CSS from src/styles/ into style.css
  • build:css:min — same + minification
  • validate_locale — checks translation JSON files

These run on your machine during development. style.css in the repo root is what SillyTavern loads. If you never run the build script, you're using whatever style.css is already committed.

Bottom line: npm commands are optional dev conveniences. SillyTavern only cares about files in manifest.json. Loading via Gitea raw URL works because SillyTavern fetches those raw files directly.

No, SillyTavern does **not** build the extension. It loads files directly as-is. **How it works:** SillyTavern reads `manifest.json` and loads `index.js` + `style.css` directly from the extension directory. No build step — it just fetches raw files and injects them into the page. **The npm commands from PR #13** are purely dev tools: - `build:css` — concatenates modular CSS from `src/styles/` into `style.css` - `build:css:min` — same + minification - `validate_locale` — checks translation JSON files These run on your machine during development. `style.css` in the repo root is what SillyTavern loads. If you never run the build script, you're using whatever `style.css` is already committed. **Bottom line:** npm commands are optional dev conveniences. SillyTavern only cares about files in `manifest.json`. Loading via Gitea raw URL works because SillyTavern fetches those raw files directly.
ARIA closed this issue 2026-07-12 13:04:10 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Pakobbix/rpg-companion-sillytavern#15