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

Configuration option loader(s) is ignored #24

Closed
karrikuivanen opened this issue Jun 3, 2021 · 2 comments
Closed

Configuration option loader(s) is ignored #24

karrikuivanen opened this issue Jun 3, 2021 · 2 comments

Comments

@karrikuivanen
Copy link

Hi,

in the same vein as #23, unless I'm mistaken, it seems that the --loader esbuild option is not currently supported.

Similarly to the externals issue, a merge of user provided loaders with the default stack could be considered.

My use case is testing modules that use static binary assets.

My esbuild-runner-config.js:

module.exports = {
  type: 'bundle',
  esbuild: {
    target: 'node14',
    format: 'cjs',
    loader: {
      '.png': 'binary'
    }
  }
}

Result:

 > lib/loader-issue.js:1:16: error: No loader is configured for ".png" files: assets/img/image.png
    1 │ import pngImage from '../assets/img/image.png'
      ╵                      ~~~~~~~~~~~~~~~~~~~~~~~~~

Thanks for a great tool!

@gustavoschmidt
Copy link

loaderS :)

@folke
Copy link
Owner

folke commented Jun 4, 2021

I just added support for custom loaders. @gustavoschmidt the option is loader without the s ;)

platform was another option that was overshadowed by esbuild-runner. Also fixed.

Let me know if you have any more issues with this.

Thank you for reporting!

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

3 participants