Closed Kocal closed 3 weeks ago
This does not actually reduce dependencies, because chalk
is still a transitive dependency of css-minimizer-webpack-plugin
. So this PR doesn't actually change the size of downloaded dependencies (picocolors
was already a transitive dependency, from css-minimizer-webpack-plugin
> cssnano
as well as other places)
In reality yes, but that's a first step, I believe someone (or me) will open this kind of PR on css-minimizer-webpack-plugin
etc, and only at this time we will be able to reduce the package size.
Looking at the npm graph, the only non-dev transitive dependencies we have are those:
@nuxt/friendly-errors-webpack-plugin
requires chalk 2.xjest-util
and @jest/types
require chalk 4.x. These are required by jest-worker
which is required by css-minimizer-webpack-plugin
@nuxt/friendly-errors-webpack-plugin
: https://github.com/nuxt/friendly-errors-webpack-plugin/pull/21
Picocolors is one of the smaller library to output colors in the terminal, and it has no sub-dependencies. It can reduce the Encore package size a lot.
Migrating from chalk to picocolors is pretty simple, the API is nearly identical except whan you want to color both text and background.
When running
encore --help
:When running
encore dev
: