Commit 1a07e2e
build: replace grunt with node terser script
PR-2 of the modernization plan: removes grunt + grunt-contrib-uglify in
favor of a ~50-line Node ESM build script that does what the gruntfile
used to do. Same dist layout, same banner format, no source changes.
scripts/build.mjs:
- Substitutes %version% from package.json into dist/jquery.autocomplete.js.
- Minifies via terser with a preamble that matches the gruntfile's banner
format exactly (no leading-space, year 2025 hardcoded as before).
- Syncs version in devbridge-autocomplete.jquery.json.
devDependency churn:
- Drop: grunt, grunt-contrib-uglify (removed 96 transitive packages).
- Add: terser. vitest already pulled terser transitively, so dedupe lands.
Output:
- dist/jquery.autocomplete.js: byte-identical to pre-PR.
- dist/jquery.autocomplete.min.js: semantically equivalent. Terser 5
emits ~73 bytes more than uglify-js 3 because it preserves slightly
more local var names; tests still pass.
Lint/format scope broadens to scripts/build.mjs but deliberately excludes
the pre-existing demo files (scripts/countries.js, scripts/demo.js) which
are runtime assets loaded by index.htm, not build tooling.
Surviving npm audit advisories (6, all dev-only) are pre-existing and
unrelated to this PR; auto-fixable separately with npm audit fix.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 4652fe9 commit 1a07e2e
7 files changed
Lines changed: 174 additions & 1131 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
38 | 48 | | |
This file was deleted.
0 commit comments