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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pivica created an issue. See original summary.

pivica’s picture

Status: Active » Needs review
FileSize
2.14 KB

Here is a patch.

pivica’s picture

FileSize
526 bytes
2.66 KB

It 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.

  • pivica committed 13cc3ba2 on 8.x-1.x
    Issue #3339903 by pivica: Update caniuse-lite in build process
    
pivica’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.