sindresorhus / grunt-sass

Compile Sass to CSS
MIT License
1.01k stars 209 forks source link

Allow any version of node-sass to be used with this plugin #266

Closed mwolson closed 8 years ago

mwolson commented 8 years ago

I'd like to allow callers of the plugin to specify whichever version of node-sass they want, so that it's easier to pin to an exact version or version range. This should also reduce the maintenance overhead for grunt-sass, since the plugin no longer has to be updated every time there is a new node-sass (beta) release.

Express node-sass as both a peerDependency and devDependency, so that it's still possible to run the test suite. Prefer non-beta version for the test suite, since the beta dist-tag seems to prevent the peer dependency from being satisfied on npm v2.14.12.

Part of the reason for doing this is that node-sass v3.5.3 made a certain practice in 3.4.0 fatal, which broke our build pipeline overnight.

sindresorhus commented 8 years ago

You can already do that. Just specify a specific node-sass version in your package.json and npm@3 will dedupe to use that one for grunt-sass. No need to complicate it with peerDependencies.

mwolson commented 8 years ago

That would mean we'd have to stop using the version of npm that's included with the node LTS releases, though, which come with npm v2.15.1. It should also prevent constant PR's for future releases of node-sass, I'd hope :) .

sindresorhus commented 8 years ago

That would mean we'd have to stop using the version of npm that's included with the node LTS releases

You should do that regardless. npm@3 fixes a lot of bugs from npm@2.

It should also prevent constant PR's for future releases of node-sass, I'd hope :) .

That is already solved thanks to semver.

I know peerDependencies sounds like a good solution, but it really isn't. I've painfully experienced all the downsides of peerDependencies. Deduping is IMHO a much better solution to this. peerDependencies brings with it its own mess of problems.