-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: move webpack to a peer dependency and allow webpack 2 #46
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. The only thing I'm wondering about now is how can we test against both webpack v1 and v2 so that it ships and is working for both?
@@ -23,14 +23,14 @@ | |||
}, | |||
"homepage": "https://github.com/vieron/stylelint-webpack-plugin#readme", | |||
"peerDependencies": { | |||
"stylelint": "^7.0.1" | |||
"stylelint": "^7.0.1", | |||
"webpack": "^2 || ^2.2.0-rc.0 || ^2.1.0-beta.0 || ^1.13.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather just have ^2.0.0 || ^1.13.2
here... I would think it's better to just "officially" support stable versions. With npm
>=3 or yarn
you won't get peerDeps installed anyway so you can still choose what version you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no breaking changes between webpack 1 and webpack 2's API that would affect this plugin, it's very safe to support the beta versions of webpack, and gets rid of the annoying peer dependency warning on install.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, because the rc
and beta
versions do not fall under semver technically so they aren't resolved by ^2.0.0
? Fair enough.
@JaKXz I've added a simple npm script to test against both v1 and v2 of webpack, LMK what you think. |
Yup that's correct, this is how all the webpack plugins have their peer dependency set under the webpack org
… On 18 Dec 2016, at 16:36, Jason Kurian ***@***.***> wrote:
@JaKXz commented on this pull request.
In package.json:
> @@ -23,14 +23,14 @@
},
"homepage": "https://github.com/vieron/stylelint-webpack-plugin#readme",
"peerDependencies": {
- "stylelint": "^7.0.1"
+ "stylelint": "^7.0.1",
+ "webpack": "^2 || ^2.2.0-rc.0 || ^2.1.0-beta.0 || ^1.13.2"
I see, because the rc and beta versions do not fall under semver technically so they aren't resolved by ^2.0.0? Fair enough.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@JaKXz I just spotted there was a merge conflict with master which I've now resolved, would you like me to make any more changes before this can be merged? 😃 |
@mattlewis92 thanks for fixing that! I'm still not sure about the way to test the different versions of webpack though. Maybe this should be a bigger discussion with @sokra and other plugin maintainers who want to maintain backwards compatibility? |
Given that webpack 2 is now in RC and there are no more breaking changes planned (and previously none that have affected this plugin) - I wouldn't worry too much about it. AFAIK the plugin / loader API will always be pretty stable to avoid breaking the webpack ecosystem - the majority of breaking changes are in the EU's webpack config itself. Maybe @TheLarkInn can give some more insight into this though? |
@mattlewis92 thank you for your patience on this! I had a look at the long thread that is npm/npm#5499 and found: https://github.com/scott113341/npm-install-version I think a programmatic solution with I really appreciate your work on this - let me know if you want to give that a shot or I can take it on if you're spent. :) |
@JaKXz I've done a basic implementation using npm-install-version - let me know if that's OK for you |
|
Awesome, thanks! 😃 |
* test: test against both webpack 1 and webpack 2 * chore: use npm install version * style: whitespace
Using this plugin with webpack 2 currently installs 2 versions of webpack.
Resolves #38.