-
Notifications
You must be signed in to change notification settings - Fork 414
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
Webpack and multiple babel modules are production dependencies #643
Comments
Just to give some context, I'm the maintainer of For the most part this has been great, but I need to also include This has caused a few issues with dependency clashes etc. For example, the latest version of As a library author my choices are:
I'm not sure how to proceed, but maybe others consuming this tool as part of a library are facing similar issues. |
webpack should be a peer dep. can you send a PR for that? regarding deps like babel, the only way is to split up the package to multiple parts such as webpack loader, babel plugin and the core API. which we plan to do in future. |
I don't think moving webpack to peer deps is a good solution. If you use linaria in a nextjs project, you'll have two webpack versions installed in your node_modules: 4.x because of linaria and 5.x because of nextjs. Also, when you move webpack to peer deps, you can't have two different packages in your project which require a different major version of webpack peer dep (say, linaria which requires 4.x and package Y which requires 5.x). Lastly, if I don't use webpack in my project (I use rollup), I'll be seeing a warning about missing peer deps, and while I know I can ignore it in my case, others may not and will install webpack even if they don't need to. I'd much rather prefer a separate package for the webpack loader, that package can have its own dependencies that are tracked independently of linaria core. |
Require is a strong word. Peer dependency isn't really enforced so no reason that you need to have 2 different versions. Unless there's real API incompatibilities. Anyway, separate package is a the long term solution and it'll take some time. Moving it to peer deps is something that can be done quickly. There's no reason not to do it and then do the separate package after it. |
Actually, the only reason why we need webpack here is |
@Anber that would be useful, but the fact that webpack is a dependency at all means it creates many conflicts when being used within a webpack consuming application. For example, I'm currently holding back from upgrading Unless of course you mean use |
@ifiokjr |
|
@Anber really excited about the progress 🙌 |
Done! |
This is a breaking change relative to 2.0.0-rc.0, my builds now fail with «Cannot find module 'webpack'» (next build) or «Cannot find module '@babel/core'» (rollup). I get a warning about @babel/core being a missing peer dependency (as per #654), but no warning about webpack. |
Environment
Description
Webpack and multiple babel modules are marked as production dependencies, inflating build sizes and production install times.
See package.json: https://github.com/callstack/linaria/blob/master/package.json#L125
The text was updated successfully, but these errors were encountered: