For static site generation, I’d love to use CSS modules (*):
– Required: support for Node.js + TypeScript + browsers
– I bundle with esbuild, so browsers are OK.
Current approach (no CSS modules, not type safe):
– Import CSS & bundle via esbuild.
– Ignore non-code imports in Node.js via a loader.
Future?
– Compile CSS to JSON with names
– Import & use JSON for SSR in Node.js. Also works in TS.
– Esbuild bundles CSS, not JSON. Via custom plugin?
Add comment