Postcss: Better utilize node_modules space.

Created on 31 Jan 2019  ·  2Comments  ·  Source: postcss/postcss

Each postcss plugin package depends on postcss which also includes a copy of source-map. In node_modules this means each small postcss package uses 1.7 mb. See attached screenshot:

screenshot from 2019-01-31 11-44-00

Can anything be done to clean up this situation?

  • It seems odd to me that each package depends on postcss.
  • Do we need a separate package for the color "gray" and the the color "rebeccapurple"

Most helpful comment

@ai I understand. I am not involved in your project to make specific recommendations, but I thought I would bring this up for your consideration.

Unfortunatelly, noone tweet about it and mentioned.

Sometimes you have to do the right thing, even when nobody else is watching :)

Thanks for your response.

All 2 comments

Yeap. it is a problem. But there is no solution right now, because:

  1. We need to track PostCSS version, which was used in plugin.
  2. Plugin need to require PostCSS. And we can’t fix it by peerDependencies, because most of users use postcss-loader and do not need to require postcss.

This is why, I suggest you to use yarn --flat

Sorry, I will close this issue, because there is no solution right now. I will reopen it when somebody will suggest me a good solution to care about all edge cases.

Don’t worry. I am share your concern about node_modules size. In the past we with @ben-eb compressed caniuse-db (about 72 MB) to caniuse-lite (around 7 MB) to reduce your node_modules. Unfortunatelly, noone tweet about it and mentioned. This is why I do not want to spend my forces in this area, no success in promotion (but I will help if somebody else will find solution).

@ai I understand. I am not involved in your project to make specific recommendations, but I thought I would bring this up for your consideration.

Unfortunatelly, noone tweet about it and mentioned.

Sometimes you have to do the right thing, even when nobody else is watching :)

Thanks for your response.

Was this page helpful?
0 / 5 - 0 ratings