logoalt Hacker News

user43928 • yesterday at 4:30 PM • 2 replies • view on HN

How would you set that up?

Like say you installed only the production dependencies, then you'd be missing the build tools, bundler, etc.

One idea would be to use hooks of your bundler to enforce that each module resolved during the production build is declared in the regular dependencies.

It would be far from a standard solution though.


Replies

andrewaylett • yesterday at 9:33 PM

https://github.com/import-js/eslint-plugin-import/blob/HEAD/...

It's not built in to ESLint, but it's fairly widely used in my experience and helps ensure that you've got a sensible split between production and non-production.

mikeryan • yesterday at 8:03 PM

NX Monorepos work that way. Broadly speaking (and with many exceptions) all packages end up in the root. It “builds” release distributions with the correct package.json files and transpiled js.

It helps keep all your related packages on the same dependencies. It’s hell for react native sometimes though.

➕ show 1 reply