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

detect whether a file can be validly imported in native node esm context #14

Closed
danielroe opened this issue Oct 22, 2021 · 1 comment · Fixed by #16
Closed

detect whether a file can be validly imported in native node esm context #14

danielroe opened this issue Oct 22, 2021 · 1 comment · Fixed by #16
Assignees
Labels
enhancement New feature or request

Comments

@danielroe
Copy link
Member

danielroe commented Oct 22, 2021

Proposed shape:

export async function isValidNativeESM (code: string, id: string): Promise<boolean> {}

Would be useful (elsewhere) to determine whether to inline a given file or whether we can treat it as an external.

@pi0
Copy link
Member

pi0 commented Oct 22, 2021

Considering it is an async function, should we move id to first and make code optional? Some patterns can be quickly checked without even reading the code like .esm.js files and .json (at the moment)

@danielroe danielroe self-assigned this Oct 27, 2021
@danielroe danielroe added the enhancement New feature or request label Oct 27, 2021
@pi0 pi0 closed this as completed in #16 Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants