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: Dynamic require of "fs" is not supported. fixes #13 #14

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

hanayashiki
Copy link
Contributor

This commit moves dotenv and dotenv-expand into dependencies from devDependencies, which lets tsup externalize them. Therefore, in the bundled code, they will be imported using native imports instead of __requires generated by esbuild, which in turn tries to call native require on NodeJS, which is not supported in NodeJS when the file is treated as an ESM. The detailed cause is clear in evanw/esbuild#1921.

This commit moves dotenv and dotenv-expand into `dependencies` from `devDependencies`, which lets tsup externalize them.
Therefore, in the bundled code, they will be imported using native `import`s instead of `__require`s generated by esbuild, which in turn tries to call native `require` on NodeJS, which is not supported in NodeJS when the file is treated as an ESM. The detailed cause is clear in evanw/esbuild#1921.
@IndexXuan IndexXuan merged commit 7548568 into IndexXuan:main Dec 1, 2023
1 check failed
@IndexXuan
Copy link
Owner

Thanks a lot. v2.0.1

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