netlify / cli

Netlify Command Line Interface
http://cli.netlify.com
MIT License
1.57k stars 347 forks source link

Is it possible to pass esbuild options to the builder? #2912

Open redmagic opened 3 years ago

redmagic commented 3 years ago

I would like to pass options to the esbuild command.

For example, the ability to indicate that the text loader should be used for html files.

https://esbuild.github.io/api/#loader

Or the ability to mark modules as external e.g. fsevents

https://esbuild.github.io/api/#external

erezrokah commented 3 years ago

Hi @redmagic, you can configure externals via netlify.toml, e.g.

[functions]
  external_node_modules = ["fsevents"]

See more here.

As for additional loaders you might want to comment on https://github.com/netlify/zip-it-and-ship-it/pull/553.