gowravshekar / font-awesome-webpack

font-awesome package for webpack
MIT License
192 stars 49 forks source link

less-loader dependency issue #4

Closed why-jay closed 8 years ago

why-jay commented 9 years ago

With the newest update to v2.7.3, NPM now warns about how NPM 3+ will no longer automatically install peer dependencies. The top-level application has to manually define them in its own package.json. If this doesn't make enough sense, please try it out on your own on NPM v2.7.3 and read the warnings.

In the context of this repository, this expected breaking change particularly becomes an issue when the top-level application defines font-awesome-webpack and the newest less-loader simultaneously in its package.json. font-awesome-webpack expects less-loader@~0.7.7, which defines a peer dependency of less@^1.5. Meanwhile, the top-level less-loader@2.1.0 defines a peer dependency of less@^2.3.1. Since NPM doesn't allow two versions of the same repository, the top-level application must choose either. But choosing either will break the other peer dependency, because ^1.5 and ^2.3.1 are incompatible.

My proposed solution to this problem is to have font-awesome-webpack expect less-loader@>=0.7.7 instead of @~0.7.7. I just tested this solution in my fork, and things seem to work fine, probably because less-loader's API hasn't changed much.

Please correct me if there's anything wrong.

EDIT: added the word "simultaneously"

why-jay commented 9 years ago

https://docs.npmjs.com/misc/faq#is-it-npm-or-npm-or-npm

Just saw this. Sorry for all the capitalizations! :P

why-jay commented 9 years ago

Ping

robtayl0r commented 8 years ago

+1

mschneid commented 8 years ago

+1

gowravshekar commented 8 years ago

Merged pull request.