eta-dev / eta

Embedded JS template engine for Node, Deno, and the browser. Lighweight, fast, and pluggable. Written in TypeScript

Home Page:https://eta.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cloudflare Pages is bundling node instead of browser version

CanRau opened this issue · comments

I'm trying to get it working in my SvelteKit with Cloudflare Pages adapter, though it's trying to bundle the node version.
I was playing around with Vite resolve.alias like

eta: "eta/dist/browser/eta.es.min",
eta: "eta/dist/browser/eta.es.min.js",
eta: "./node_modules/eta/dist/browser/eta.es.min"

but sadly no "luck" so far, any tips?

I'm not super familiar with Vite or SvelteKit, but this should be doable. Reading the Vite docs, it states:

When aliasing to file system paths, always use absolute paths. Relative alias values will be used as-is and will not be resolved into file system paths.

Could you try setting it to an absolute path to check how it goes from there?

@CanRau were you able to get this resolved?

@nebrelbug I believe I had it working with an absolute path, I might try again if I have the time

This issue is stale and was likely resolved with the changes to module resolution, so I'm going to close it.