My local development environment uses Play CDN to enhance the development experience, and I use the cjstoesm module to convert the tailwind.config.js configuration file into a native ESM to keep it the same as the production environment.
However, because the plugin uses the fs module, it will not work in the browser. If there is a way to be compatible that would be great!
/*
* [Package Error] [Package Error] "fs" does not exist. (Imported by "@egoist/tailwindcss-icons").
*
* The package "@egoist/tailwindcss-icons" depends on this Node.js built-in module.
* Node.js built-in modules (like "fs", "http", etc.) are Node.js-specific, and do
* not exist in non-Node environments like Deno or the web browser. Skypack CDN polyfills
* most of these modules for you automatically, but this one could not be polyfilled.
*
* How to fix:
* - Let the package author know that you'd like to run their package in the browser.
* - Use https://skypack.dev/ to find a web-friendly alternative to find another package.
*/
My local development environment uses Play CDN to enhance the development experience, and I use the
cjstoesm
module to convert thetailwind.config.js
configuration file into a native ESM to keep it the same as the production environment. However, because the plugin uses thefs
module, it will not work in the browser. If there is a way to be compatible that would be great!Play CDN
cjs-to-esm.js