Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replace Autoprefixer browsers option to Browserslist

Tags:

i am using [Metronic v6.03]

I followed the Quick Start tutorial on documentation. https://keenthemes.com/metronic/?page=docs

If I give in the command ‘gulp build’ I get a message :

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

Using browsers option cause some error. 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”

The Theme don’t compiles correctly.

NPM version : 6.9.0

Yarn version : 1.16.0

Gulb version

CLI : 2.2.0

Local version : 4.0.2

I changed the line browserlist at package.json to

"browserslist": [

"last 1 version",

"> 1%",

"maintained node versions",

"not dead"

]

and try to replace the line with :

"browserslist": [

"defaults"

]

On Linux I added a file .browserslistrc with the lines above.

like image 500
John Zakaria Avatar asked Jun 18 '19 11:06

John Zakaria


People also ask

What is the use of Browserslist?

Browserslist is a tool that allows specifying which browsers should be supported in your frontend app by specifying "queries" in a config file. It's used by frameworks/libraries such as React, Angular and Vue, but it's not limited to them.

What is Browserslist NPM?

The config to share target browsers and Node. js versions between different front-end tools. It is used in: Autoprefixer.


1 Answers

The problem will be in gulpfile.js.

Look for autoprefixer(), this function will have some options passed as parameter. Remove those options. And move them to your package.json as browserslist: ["browserConfig1", "browserConfig2", "..."].

like image 124
Steve Maris Avatar answered Sep 19 '22 15:09

Steve Maris