GoogleChromeLabs / critters

🦔 A Webpack plugin to inline your critical CSS and lazy-load the rest.
https://npm.im/critters-webpack-plugin
Apache License 2.0
3.42k stars 108 forks source link

fix: CJS distributable consumption #127

Closed alan-agius4 closed 1 year ago

alan-agius4 commented 1 year ago

The used versions of chalk and pretty-bytes are ESM packages which breaks CJS consumption as they are not loaded using ESM dynamic imports.

Example of error

Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/critters/node_modules/chalk/source/index.js from /node_modules/critters/dist/critters.js not supported.

This commit downgrades these packages to their CJS versions.