Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@DamienRobert
Copy link
Contributor

Commit a1bf895 changed the browserslist
request from
browserslist(this.browsersRequest)
to
browserslist(this.browsersRequest, { from })

But in browserslist the option name for the path is 'path'. This commit
corrects this. Note that this means that before, since 'path' was not specified,
browserslist would fallback to the current working directory for the
config file look up.

With this commit, if no queries are specified, browserslist will look up
for a config file up from the specified path rather than the current working
directory. This conforms with autoprefixer behavior.

@ai
Copy link
Collaborator

ai commented Dec 18, 2017

Yeap. path is correct.

@DamienRobert note that tests were failed

@DamienRobert
Copy link
Contributor Author

DamienRobert commented Dec 18, 2017

Hum I need to update the code to only pass '{path: from}' when it is well defined. Indeed browserslist fallback to '.' is as follow:

  if (!opts.hasOwnProperty('path')) {                                           
    opts.path = path.resolve ? path.resolve('.') : '.'                          
  }                                                                             

so passing a undefined 'path' prevents the fallback.

Edit: I updated the PR

Commit a1bf895 changed the browserslist
request from
    browserslist(this.browsersRequest)
to
    browserslist(this.browsersRequest, { from })

But in browserslist the option name for the path is 'path'. This commit
corrects this. Note that this means that before, since 'path' was not specified,
browserslist would fallback to the current working directory for the
config file look up.

With this commit, if no queries are specified, browserslist will look up
for a config file up from the specified path rather than the current working
directory. This conforms with autoprefixer behavior.

Note that we only pass 'from' if it is not null, this allows
browserslist to fallback to the current directory when no path is
provided.
This let browserslist pick up a '.browserslistrc' if no browsers are
provided. If such a file is not found it will default to
browserslist.defaults anyway.
@DamienRobert
Copy link
Contributor Author

I pushed a new commit to let the cli be able to work with a .browserslistrc rather than defaulting always to browserslist.defaults.

@ai
Copy link
Collaborator

ai commented Dec 19, 2017

@DamienRobert it is awesome work! Bu the way, maybe you want to have a popular open source project and want to maintain this awesome project? Current maintainer is looking for the replacement. And this project is the best way to get experience since I will help here.

@pkuczynski pkuczynski changed the title Conform to browserslist api Conform to browserslist API Mar 23, 2018
@pkuczynski pkuczynski merged commit 7560bb2 into anandthakker:master Mar 23, 2018
@pkuczynski pkuczynski added this to the 4.1.0 milestone Mar 23, 2018
@DamienRobert
Copy link
Contributor Author

Thanks for merging this!

@ai: unfortunately I really don't have time to help maintain a project right now, sorry!

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

Successfully merging this pull request may close these issues.

3 participants