Such as for instance, this will be of good use if you’re using a document watcher solution
You may also utilize this API should your explore circumstances comes to contacting esbuild’s make API a couple of times with the exact same options. Incremental produces be a little more efficient than just normal produces as the some of the information and knowledge is cached and certainly will feel used again should your unique data have not altered while the last create. You’ll find currently several forms of caching utilized by the newest progressive build API:
Data files is stored in thoughts and are also maybe not re also-see on document program when your document metadata has never changed once the last build. So it optimization only pertains to file program routes. It does not connect with digital modules developed by plugins.
Parsed ASTs try kept in memories and you can re also-parsing the AST are avoided in the event your file content material have not altered just like the last build. That it optimization pertains to digital modules produced by plugins on top of that so you’re able to file system modules, so long as the new virtual module road continues to be the same.
That one says to esbuild what to do about JSX syntax. You may either provides esbuild alter JSX to JS (the newest default) otherwise keep new JSX sentence structure in the yields. In preserving JSX syntax:
Observe that if you [image error] uphold JSX syntax, the newest efficiency records are no stretched valid JavaScript password. This feature is intended to be used if you want in order to transform the latest JSX syntax inside the esbuild’s productivity data from the various other tool just after bundling, usually one which have an alternate JSX-to-JS alter compared to one to esbuild tools.
#JSX facilityYou can label one thing apart from Behave.createElement of the altering the fresh new JSX warehouse. Including, to name the event h alternatively (which is used of the other libraries instance Preact):
Alternatively, when you use TypeScript, you can just configure JSX having TypeScript by the addition of it so you’re able to their tsconfig.json file and esbuild is figure it out immediately without the need for are designed:
#JSX fragmentYou need to use a feature other than Act.Fragment from the altering this new JSX fragment. Such as for instance, to make use of the fresh role Fragment alternatively (which is used by the other libraries for example Preact):
Rather, by using TypeScript, you can just arrange JSX to possess TypeScript by the addition of that it to the tsconfig.json file and you may esbuild is always to figure it out instantly without needing getting designed:
#Remain namesIn the JavaScript title property on functions and you can groups defaults to help you your local identifier regarding the provider password. These types of syntax models prepared title assets of your setting so you’re able to “fn” :
However, minification renames symbols to minimize code size and you can bundling often need so you can rename symbols to get rid of collisions. You to definitely transform value of the name property for many of those times. Normally, this is okay while the label home is generally speaking just used in debugging. Yet not, specific structures trust title assets getting subscription and binding purposes. Should this be possible, you could potentially allow this in preserving the original term viewpoints even yet in minified code:
#Court commentsA great “court remark” is considered to be one declaration-peak remark in the JS or signal-top feedback in the CSS who has or otherwise one starts with //! or /*! . These comments was maintained in the yields documents automatically as you to comes after the intent of one’s amazing people of your own code. Although not, that it decisions are configured that with among the adopting the options:
This new standard conclusion was eof when package try allowed and you will inline otherwise. Function the newest legal remark means looks like so it:
Note that “statement-level” having JS and you will “rule-level” for CSS setting the newest comment must are available in a framework where multiple comments or guidelines are permitted such in the top-level extent or even in an announcement or signal cut-off. So statements to the expressions or in the statement height are not thought licenses comments.


