Open nadecancode opened 2 years ago
Looks like process is only used to get env vars.
If you'd like to try a PR, here's what should work:
Create a utility function named tryGetEnvVar
that does return process && process.env[varName];
Replace process.env
references with calls to the new utility function
Note: for the transform.js file, you'd have to embed the logic directly, as you can't import.
If it works, open a PR and I'll get it through!
Can you tell me how you import this lib in your worker? In my knowledge, cf don't support nodejs.
https://blog.cloudflare.com/node-js-support-cloudflare-workers/
Looks like it's a sandbox. They recommend webpack.
I'm wondering if your new build would work as is due to having a browser build.
blog.cloudflare.com/node-js-support-cloudflare-workers
Looks like it's a sandbox. They recommend webpack.
I'm wondering if your new build would work as is due to having a browser build.
It's should work if he import the browser bundle
I was trying to find something like this for CloudFlare too, but I think the way to go will be through the HTMLRewriter API
My PR ☝️ fixes this library to work in Cloudflare workers.
Would be great to get the above PR merged!
I've published the above pr (similar changes) here https://www.npmjs.com/package/node-html-markdown-cloudflare, if you can't wait to use this on Cloudflare 😄
Looks like Cloudflare Worker does not like
process
, is it possible to remove these queries so it can support Cloudflare Worker?