Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | update-caniuse-lite-33399030-3.patch | 2.66 KB | pivica |
#3 | interdiff-33399030-2-3.txt | 526 bytes | pivica |
Comments
Comment #2
pivica CreditAttribution: pivica at MD Systems GmbH commentedHere is a patch.
Comment #3
pivica CreditAttribution: pivica at MD Systems GmbH 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 CreditAttribution: pivica at MD Systems GmbH commentedCommitted.