New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloudflare workers compatibility #40
Comments
Hey @theKashey, I have tested this library with Clouldflare worker, and it works great. All we need is to use |
Frankly speaking - have no idea how to conditionally target package for a 'worker'. Probably it will be You might look into two solutions:
|
Hmm... the wired thing is even though we did isolate, once a module containing For now, I will fork this library and modify it for running on the worker. |
That is actually a really good solution to unblock yourself as well as being able to verify assumption and provide a way forward for the 'mainstream' |
Hello 馃憢馃徎
We are wanting to use this library with Cloudflare workers, and thes during SSR we cannot scan the directory.
used-styles/src/scanForStyles.ts
Line 18 in cb432b1
used-styles/src/scanForStyles.ts
Line 157 in cb432b1
So was hoping we can extract the core functionality into a series of helpers so that during node, for sure you can scan a file system, and in workers one can use Workers KV to read the css files (or local fetch within context of Pages).
loadStyleDefinitions
doesn't require to be in that file.So mainly about 2 main moments.
fs
.The text was updated successfully, but these errors were encountered: