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

test: failing test for #38 #41

Closed
wants to merge 1 commit into from
Closed

test: failing test for #38 #41

wants to merge 1 commit into from

Conversation

privatenumber
Copy link
Owner

@privatenumber privatenumber commented Jun 21, 2022

Failing test for #38

@remorses
Copy link

I think this can be fixed by passing platform: 'node' to esbuild, this will emit cjs annotation like these

0 && (module.exports = {
  x
});

Here is its documentation: https://esbuild.github.io/api/#platform

@remorses
Copy link

i just noticed transform is missing that option, i opened an issue for that evanw/esbuild#2362

Otherwise we could use the build api and mark everything as external

@privatenumber
Copy link
Owner Author

privatenumber commented Jun 30, 2022

I commented this in #38 (comment), but I already went down that path via evanw/esbuild#2248.

@remorses
Copy link

remorses commented Jul 2, 2022

Sorry but what you said in #2362 about directly reading from disk does not apply to #38, because in that case the cjs file is a typescript file, so it will be transformed anyway

@privatenumber
Copy link
Owner Author

Do you have any research to back that up?

To me, it looks like a pretty straight forward fs.readFileSync without any consideration for the possibility of transformation: https://github.com/nodejs/node/blob/bde889bd4ed68d33163897b4175557fbc669b66f/lib/internal/modules/esm/translators.js#L211

@privatenumber privatenumber deleted the branch develop April 26, 2024 09:56
@privatenumber privatenumber deleted the test-38 branch April 28, 2024 21:39
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants