Semantic-Org / Semantic-UI

Semantic is a UI component framework based around useful principles from natural language.
http://www.semantic-ui.com
MIT License
51.09k stars 4.95k forks source link

[Build] Replace Autoprefixer browsers option to Browserslist config warning #6939

Open sprilukin opened 4 years ago

sprilukin commented 4 years ago

Autoprefixer warning during building custom theme with the following message:

  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

Steps

Create a sample project which uses semantic-ui:

Expected Result

Build should be successful without any warning

Actual Result

Autoprefixer complains about it's config

Version

2.4.2

Seems to be caused by autoprefixer's 9.6 release.

In the gulp tasks file semantic/tasks/config/tasks.js we can see:

    /* What Browsers to Prefix */
    prefix: {
      browsers: [
        'last 2 versions',
        '> 1%',
        'opera 12.1',
        'bb 10',
        'android 4'
      ]
    },

once I've moved browsers part to package.json as

"browserslist": [
    "last 2 versions",
    ",> 1%",
    "opera 12.1",
    "bb 10",
    "android 4"
  ]

warning disappeared

lubber-de commented 4 years ago

FYI, https://fomantic-ui.com has this fixed since 2.7.7 by https://github.com/fomantic/Fomantic-UI/pull/810