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

@babel/preset-react and babel-plugin-dynamic-import-node #257

Open
KatSick opened this issue Jul 25, 2023 · 5 comments
Open

@babel/preset-react and babel-plugin-dynamic-import-node #257

KatSick opened this issue Jul 25, 2023 · 5 comments

Comments

@KatSick
Copy link

KatSick commented Jul 25, 2023

is there any reason why @babel/preset-react and babel-plugin-dynamic-import-node in dependencies section of the package.json and not in devDependencies?

It bloats our application node_modules a lot, because of it

@ljharb
Copy link

ljharb commented Jul 25, 2023

Because they're runtime dependencies:

@KatSick
Copy link
Author

KatSick commented Jul 25, 2023

@ljharb I agree, but for example here

return require('webpack');
you are using webpack but do not specify it in dependencies

I'm asking, because we are using Happo with Cypress, without any babel configurations, and I'm wondering how can I avoid it.

as I understand, as soon as this is not a monorepo with more modular packages which can be published separately it is not possible?

--
thanks for super fast reponse!

@ljharb
Copy link

ljharb commented Jul 25, 2023

https://github.com/happo/happo.io/blob/master/package.json#L109 is where webpack is specified as a peer dep.

I don't think you can avoid it.

@KatSick
Copy link
Author

KatSick commented Jul 26, 2023

@ljharb can we move babel presets to peerDeps as well? (sorry for all the questions)

@ljharb
Copy link

ljharb commented Jul 26, 2023

Peer deps are strictly required, so that wouldn't help your problem at all - it'd just be a breaking change and additional burden on users to install them themselves.

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

No branches or pull requests

2 participants