mirror of
https://github.com/photoprism/photoprism.git
synced 2026-07-17 16:49:04 +00:00
Build: Run precompress.js after npm build in build-js targets #5552
The repo Makefile and dev image both export NPM_CONFIG_IGNORE_SCRIPTS=true to harden npm against malicious supply-chain scripts. That flag also suppresses lifecycle hooks like postbuild and prewatch, so the precompress hooks registered in frontend/package.json never fire under the standard build flow. Wiring `node scripts/precompress.js` explicitly into build-js (and `--clean` into watch-js) keeps the security-conscious npm flag intact while guaranteeing siblings exist after every release-track build and that stale siblings are wiped before watch-mode dev iteration starts. The npm hooks remain registered as a backup for ad-hoc `npm run build` invocations where IGNORE_SCRIPTS is off.
This commit is contained in:
parent
9bbe7e27a0
commit
f22cba92d3
1 changed files with 2 additions and 0 deletions
2
Makefile
2
Makefile
|
|
@ -404,6 +404,7 @@ zip-nsfw:
|
|||
(cd assets && zip -r nsfw.zip nsfw -x "*/.*" -x "*/version.txt")
|
||||
build-js:
|
||||
(cd frontend && env BUILD_ENV=production NODE_ENV=production npm run build)
|
||||
(cd frontend && node scripts/precompress.js)
|
||||
build-go: build-develop
|
||||
build-develop:
|
||||
rm -f $(BINARY_NAME)
|
||||
|
|
@ -466,6 +467,7 @@ build-setup: build-setup-nas-raspberry-pi
|
|||
build-setup-nas-raspberry-pi:
|
||||
./scripts/setup/nas/raspberry-pi/build.sh
|
||||
watch-js:
|
||||
(cd frontend && node scripts/precompress.js --clean)
|
||||
(cd frontend && env BUILD_ENV=development NODE_ENV=production npm run watch)
|
||||
test-js:
|
||||
$(info Running JS unit tests...)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue