indooorsman / esbuild-css-modules-plugin

A esbuild plugin to bundle css modules into js(x)/ts(x)
MIT License
92 stars 16 forks source link

skip generating build ID when `inject` is `false` #47

Closed markdalgleish closed 1 year ago

markdalgleish commented 1 year ago

I ran into a couple of issues with the getBuildId logic — see #45 and #46.

Digging into this further, I found that the build ID is only used when the inject option is set to true, but in my case it's set to false.

As a simple hot-fix I realised it's possible to skip generating the build ID entirely if we're outputting static CSS, meaning that any errors in the build ID logic are now irrelevant for my use case.

Ideally the issues with getBuildId should be fixed too, but they're a bit more involved than this simple fix.

indooorsman commented 1 year ago

I have fixed getBuildId in the latest release, could you please have a try and let me know whether it works?