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

Fix esm support #77

Merged
merged 2 commits into from
Apr 23, 2023
Merged

Fix esm support #77

merged 2 commits into from
Apr 23, 2023

Conversation

montalvomiguelo
Copy link
Collaborator

Issue

__dirname is unavailable when enabling ESM via package.json, which makes the plugin throw the following error:

[vite] Internal server error: __dirname is not defined

Solution

This PR introduces a polyfill for __dirname leveraging import.meta.url to support ESM.

@netlify
Copy link

netlify bot commented Apr 23, 2023

Deploy Preview for bespoke-flan-5eacfc canceled.

Name Link
🔨 Latest commit 2a5b419
🔍 Latest deploy log https://app.netlify.com/sites/bespoke-flan-5eacfc/deploys/64458e8652a452000842163f

@montalvomiguelo montalvomiguelo merged commit 3b41544 into main Apr 23, 2023
@montalvomiguelo montalvomiguelo deleted the fix-esm-support branch April 25, 2023 16:17
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.

1 participant