build: Integrate webpack into build script

- Add `webpack` as a devDependency in `package.json`.
- Update `build-bookmarklet.sh` to run `npm install --silent` and `npx webpack` automatically, ensuring the required `dist/kantine.bundle.js` is generated before packaging.

Co-authored-by: TauNeutrino <1600410+TauNeutrino@users.noreply.github.com>
This commit is contained in:
google-labs-jules[bot]
2026-03-10 14:29:42 +00:00
parent 029bcf012c
commit c253588390
4 changed files with 48 additions and 107 deletions

View File

@@ -21,6 +21,12 @@ mkdir -p "$DIST_DIR"
echo "=== Kantine Bookmarklet Builder ($VERSION) ==="
# Ensure npm dependencies are installed and run Webpack to build the bundle
echo "Running npm install to ensure dependencies..."
npm install --silent
echo "Running webpack..."
npx webpack
# Check files exist
if [ ! -f "$CSS_FILE" ]; then echo "ERROR: $CSS_FILE not found"; exit 1; fi
if [ ! -f "$JS_FILE" ]; then echo "ERROR: $JS_FILE not found"; exit 1; fi