Skip to content

Support script type module#6

Open
phocks wants to merge 1 commit intomainfrom
script-type-module
Open

Support script type module#6
phocks wants to merge 1 commit intomainfrom
script-type-module

Conversation

@phocks
Copy link
Copy Markdown
Member

@phocks phocks commented Apr 23, 2026

I think this might be a good way to handle local dev with Vite which supports only script type="module". Any objections to adding this capability here? I was building my own thing that pretty much did the same thing except with a ?proxy=https://localhost query string. But this is already built and it works.

I guess we would update the readme too to tell people how to do it like: proxy('project-name', { type: "module"}).then(init);

@phocks phocks requested a review from drzax April 23, 2026 04:25
@github-actions
Copy link
Copy Markdown

size-limit report 📦

Path Size
dist/index.mjs 910 B (+2.48% 🔺)
dist/index.js 1.15 KB (+2% 🔺)

@drzax
Copy link
Copy Markdown
Member

drzax commented Apr 23, 2026

This seems like a useful change, but I'm not sure it makes dev-proxy usable with the new aunty as it currently stands — unless I'm missing something.

The issue I ran into is that proxy('project-name') will pick up both the project-name/coremedia.js and project-name/module/coremedia.js scripts and then double load the non-/module/ one instead of just loading project-name/coremedia.js once and letting it deal with loading its own modules. Which is what I think needs to happen?

@phocks
Copy link
Copy Markdown
Member Author

phocks commented Apr 23, 2026

You're correct. But it should work with this new method I'm prototyping. If you're happy to merge I'll test it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants