Skip to content

Instantly share code, notes, and snippets.

@mxro
Created August 17, 2022 20:20
Show Gist options
  • Select an option

  • Save mxro/d40f3c3f58eb276b42ebdc65224eb0ee to your computer and use it in GitHub Desktop.

Select an option

Save mxro/d40f3c3f58eb276b42ebdc65224eb0ee to your computer and use it in GitHub Desktop.
import { build } from 'esbuild';
import cssServerPlugin from 'esbuild-css-modules-server-plugin';
const generatedCss: string[] = [];
const res = await build({
plugins: [
cssServerPlugin({
onCSSGenerated: (css) => {
generatedCss.push(css);
},
}),
],
});
console.log('Generated CSS:');
console.log(generatedCss.join('\n'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment