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

A new push for an empty/no-op loader #1541

Closed
geoffharcourt opened this issue Aug 23, 2021 · 0 comments
Closed

A new push for an empty/no-op loader #1541

geoffharcourt opened this issue Aug 23, 2021 · 0 comments

Comments

@geoffharcourt
Copy link

geoffharcourt commented Aug 23, 2021

Hi, first off I want to thank you for all the incredible and rapid development that's happened on esbuild.

I've been trying to make esbuild work for us with Jest, and have run into an issue with CSS and Sass. We currently process these imports with a PostCSS plugin in our builds. We don't need the actual resulting CSS for our tests, but all the existing transforms end up failing to build files that import PostCSS/SCSS because of non-CSS syntax.

I see you've decided not to add an empty loader in #180 because no-op-ing on an import can be done through plugins. However, Jest doesn't support anything asynchronous in transforms and plugins only work in async builds, so there's a gap we can't work around.

Using esbuild had such a huge effect on our test suite's speed, I'd love to make it work. In light of this use case (needing to bypass an import in synchronous builds and synchronous builds being required for Jest transforms) would you be open to reconsidering PR #180 and adding an empty/no-op loader to allow users to bypass certain kinds of imports in certain builds? The specific thing we want to do is to no-op Sass since it's not relevant to Jest tests (and would otherwise need a plugin).

Thanks for your time!

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

No branches or pull requests

1 participant