Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support both CommonJS and ES Module entry points #22

Merged
merged 1 commit into from
Sep 27, 2021
Merged

Conversation

marvinhagemeister
Copy link
Member

@marvinhagemeister marvinhagemeister commented Sep 27, 2021

Fixes #21

@Legend1991
Copy link

Legend1991 commented Oct 4, 2021

@marvinhagemeister
I have an issue when using ESM

failed to load config from ./vite.config.js
error when starting dev server:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module './node_modules/@preact/preset-vite/dist/esm/devtools.js' imported from ./node_modules/@preact/preset-vite/dist/esm/index.mjs

postbuild.mjs script renames devtools.js file to devtools.mjs, but inside index.mjs you still do import devtools.js

I had to rollback to v2.1.1

@marvinhagemeister
Copy link
Member Author

@Legend1991 Thanks for pinging me. Just published v2.1.3 to address this issue.

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.

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module @preact\preset-vite when scaffolding vanilla preact
3 participants