Skip to content
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

Remove webpack from peerDependencies #1567

Closed
feedm3 opened this issue Jan 24, 2024 · 7 comments · Fixed by #1568
Closed

Remove webpack from peerDependencies #1567

feedm3 opened this issue Jan 24, 2024 · 7 comments · Fixed by #1568

Comments

@feedm3
Copy link

feedm3 commented Jan 24, 2024

Modification Proposal

We are using css-loader with rsbuild. This means, we don't use webpack directly anymore / don't have it installed. css-loader still works fine with the setup, but when doing a yarn install, yarn complains about not having webpack listed in our dependencies.

➤ YN0002: │ my-awesome-rsbuild-webapp doesn't provide webpack (p1ea2d), requested by css-loader.

As css-loader doesn't use webpack directly, I think it's ok to just remove it from the peerDependencies array.

Expected Behavior / Situation

The loader will behave the same, but in the context of rsbuild won't add a warning in the install logs.

Actual Behavior / Situation

A warning in the install logs:

➤ YN0002: │ my-awesome-rsbuild-webapp doesn't provide webpack (p1ea2d), requested by css-loader.

@feedm3 feedm3 changed the title Remove webpack as peerDependencies Remove webpack from peerDependencies Jan 24, 2024
@alexander-akait
Copy link
Member

@snitin315
Copy link
Member

Does rspack support all loaders & plugins? We'll need to update it in them too.

@feedm3
Copy link
Author

feedm3 commented Jan 26, 2024

We can't remove webpack, we can do this jantimon/html-webpack-plugin@main/package.json#L58 and this jantimon/html-webpack-plugin@main/package.json#L62

Hm, I guess that doesn't really help. Now not only Webpack but also Rspack is required, so all Webpack users will also get this installation warning. AFAIK there is no way to have conditional peerDependencies. :/

Does rspack support all loaders & plugins? We'll need to update it in them too.

Not sure which ones are compatible, but "Rspack loader is designed to reuse the webpack loader, it is compatible with most of the webpack loader API, the rest of the API is still being implemented, so most of the webpack loader can already run in Rspack."

@alexander-akait
Copy link
Member

alexander-akait commented Jan 26, 2024

@feedm3 Please read how peerDependenciesMeta works, it was designed specifically for this and we use this for other loaders/plugins/tools which have compatibility with rspack

@feedm3
Copy link
Author

feedm3 commented Jan 26, 2024

@feedm3 Please read how peerDependenciesMeta works, it was designed specifically for this and we use this for other loaders/plugins/tools which have compatibility with rspack

Oh sorry, I totally overlooked that one! You are right, this looks like a solution :)

@alexander-akait
Copy link
Member

@feedm3 Feel free to send a PR

@feedm3
Copy link
Author

feedm3 commented Jan 30, 2024

@alexander-akait: There is now a PR for css-loader and postcss-loader:

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 a pull request may close this issue.

3 participants