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

added support for esbuild loader option #337

Merged
merged 5 commits into from
Sep 17, 2023

Conversation

Flammae
Copy link
Contributor

@Flammae Flammae commented Sep 6, 2023

Adds support for a new esbuild.loader option.

Currently, loader cannot be configured and is guessed by the file extension. One possible use case is allowing users to use jsx loader for .js files.

@antfu antfu requested a review from sxzz September 6, 2023 20:58
src/types.ts Outdated Show resolved Hide resolved
@Flammae
Copy link
Contributor Author

Flammae commented Sep 7, 2023

I'm not sure which one's more desired:
a. Passing the result of fs.readFile to the loader functions code argument or
b. Passing the result of plugin.transform which we already have by the time loader is returned.
In this version I decided to go with the second option.

@Flammae
Copy link
Contributor Author

Flammae commented Sep 16, 2023

Hey @sxzz, any updates/instructions on this?

If you are undecided on my previous comment, we could just merge the first version of loader?: Loader (constant value, no function) and wait for the feedback. That way a chunk of the use case can be addressed instantly. And if a function is ever implemented it won't be a breaking change

@antfu antfu merged commit a94366c into unjs:main Sep 17, 2023
7 checks passed
@Flammae Flammae deleted the feat/esbuild-loader-option branch September 18, 2023 09:47
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.

3 participants