You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Practical use-case: for me, this is needed for interop with webpack.
A team I’m working with is trying to switch to ESBuild for development, keeping webpack in production. In the codebase, there’re a few cases where a .js file is being loaded with raw-loader. In webpack, it’s possible to match these files with test: /\.raw\.js$/ and apply the loader selectively; but ESBuild throws an error.
The text was updated successfully, but these errors were encountered:
iamakulov
changed the title
Loader: support files with multiple exceptions
Loader: support files with multiple extensions
Jul 2, 2020
Yes, I've been planning to do this. A use case I have in mind for later is .css vs .module.css. The behavior that makes the most sense to me is for it to pick the loader with the longest match.
@anubra266 What I did in a similar case was renaming these files from something.tsx to something.raw.tsx and then assigning a text loader to the .raw.tsx extension:
Right now, the
loader
option doesn’t support matching by multiple extensions. For example:Would it be possible to support this?
Practical use-case: for me, this is needed for interop with webpack.
A team I’m working with is trying to switch to ESBuild for development, keeping webpack in production. In the codebase, there’re a few cases where a
.js
file is being loaded withraw-loader
. In webpack, it’s possible to match these files withtest: /\.raw\.js$/
and apply the loader selectively; but ESBuild throws an error.The text was updated successfully, but these errors were encountered: