Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoprefixer issue #417

Open
easYnow opened this issue Aug 4, 2020 · 2 comments
Open

Autoprefixer issue #417

easYnow opened this issue Aug 4, 2020 · 2 comments

Comments

@easYnow
Copy link

easYnow commented Aug 4, 2020

Hi

I'm getting the following notice when running npm run watch on a project -

Replace Autoprefixer browsers option to Browserslist config.
  Use browserslist key in package.json or .browserslistrc file.

  Using browsers option can cause errors. Browserslist config 
  can be used for Babel, Autoprefixer, postcss-normalize and other tools.

  If you really need to use option, rename it to overrideBrowserslist.

  Learn more at:
  https://github.com/browserslist/browserslist#readme
  https://twitter.com/browserslist

Can anyone please offer guidance on where to edit files for this issue?

Thanks
Tom

@garretthyder
Copy link
Collaborator

Hello @easYnow

Currently the codebase passes browser information via the autoprefixer browser config here;
https://github.com/JeremyEnglert/JointsWP/blob/master/gulpfile.js#L122

It appears that the Autoprefixer tool now uses Browserslist;
https://github.com/postcss/autoprefixer#browsers
*Hence the prompt you're seeing, appears like a warning so should still work but to dismiss you can make the switch.

To switch you can remove the 'browsers' part of the gulpfile.js call to autoprefixer (first link in post above), then either "Use browserslist key in package.json or .browserslistrc file."

The format seems similar so you might be able to just move the "browsers" array from the gulpfile.js into the package.json and rename it to "browserslist", then rebuild your project.

You may need to tweak it and can consult their github documentation;
https://github.com/browserslist/browserslist#readme

If you do get it working let us know would love a snippet or PR as I'm sure others would appreciate a fix as it seems it's a fairly new change to autoprefixer. Specifically seems to have come out in Autoprefixer 9.6;
https://github.com/postcss/autoprefixer/blob/master/CHANGELOG.md#96-nunc-id-vides-nunc-ne-vides

@easYnow
Copy link
Author

easYnow commented Aug 19, 2020

Hey Garret,

Thanks for your help on this!
Just had a chance to work through this, and got it working by removing the browsers array and adding the .browserslistrc file.
The crucial step I had missed was re-building the project.
Thanks again!
Tom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants