Problem/Motivation
Theme build process complains often with next message:
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
And then you need to manually execute `npx browserslist@latest --update-db` for all custom themes.
This is a bit boring to do all the time.
Proposed resolution
Add `npx browserslist@latest --update-db` command into package.json `build-css` so it is executed every time, so it should look like this:
"scripts": {
"build-css": "((type pnpm && pnpm install) || npm install) && npx browserslist@latest --update-db && npx gulp clean:css && npx gulp sass"
}
Also add update function that is updating all child themes package.json with this.
Comments
Comment #2
pivica commentedHere is a patch.
Comment #3
pivica commentedIt seems it is better to pass `--yes` parameter to `npm run build-css` command so if we get a prompt while running theme update we will not get stuck on the prompt we do not see.
Comment #5
pivica commentedCommitted.