nitro icon indicating copy to clipboard operation
nitro copied to clipboard

cloudflare modules

Open pi0 opened this issue 2 years ago • 2 comments

https://github.com/nuxt/framework/issues/484

https://developers.cloudflare.com/workers/cli-wrangler/configuration#modules

Using this, we can natively use imports for chunks instead of using one entry (maybe behind a flag?)

~~An alternative might be using KV + eval but last time checked both eval and importScripts were forbidden due to security concerns they had. So it is probably the only way to use the native option.~~

Note: This is not replacing normal workers as is a paid service.

pi0 avatar Apr 12 '22 17:04 pi0

Note: This is not replacing normal workers as is a paid service.

I'm not sure what you mean with this sentence... But I can confirm that eval is not supported : https://developers.cloudflare.com/workers/runtime-apis/web-standards/#javascript-standards

Hebilicious avatar May 01 '22 18:05 Hebilicious

I was going to open a issue for a cloudflare pages preset proposal based off of this https://github.com/unjs/nitro/discussions/110 discussion, but wanted to make sure it's not a duplicate of this one first. This issue is tagged as a preset proposal as well, though atleast to me cloudflare modules itself sound like a change from the existing old cloudflare workers syntax to to ES modules. Does this issue include a cf pages preset or should I open a seperate one which people can then be pointed at?

warflash avatar May 04 '22 22:05 warflash

Closing as this landed with https://github.com/unjs/nitro/pull/681

Hebilicious avatar Jun 30 '23 22:06 Hebilicious