You may also use this API whether your use situation involves getting in touch with esbuild’s build API several times with similar solutions. Progressive produces be more efficient than regular builds as a few of the details is actually cached and can become used again in the event your modern files haven’t altered as past build. You can find already a couple of different caching utilized by new incremental make API:
Data files is stored in memories and are also not re-read regarding document program should your document metadata has never altered just like the last create. That it optimization merely relates to file program pathways. It generally does not connect with virtual modules produced by plugins.
Parsed ASTs is stored in recollections and lso are-parsing the newest AST is actually averted if the file articles have not altered as the history generate. It optimization pertains to digital segments created by plugins additionally in order to file system segments, provided the fresh new digital component roadway continues to be the exact same.
This 1 says to esbuild how to handle JSX syntax. You can either enjoys esbuild transform JSX so you’re able to JS (the brand new standard) or preserve the brand new JSX sentence structure about returns. In preserving JSX sentence structure:
Note that for people who keep JSX syntax, the newest yields data files are not any expanded good JavaScript password. This particular feature will be made use of when you need so you’re able to change brand new JSX syntax inside esbuild’s production records of the various other equipment after bundling, constantly one to having a special JSX-to-JS alter compared to the you to esbuild tools.
#JSX factory
You could phone call some thing aside from Act.createElement by the altering the brand new JSX factory. Eg, to call the event h alternatively (which is used because of the most other libraries such as Preact):
Instead, if you use TypeScript, you can simply configure JSX getting TypeScript adding so it to your tsconfig.json file and you may esbuild should pick it up instantly without needing as set up:
#JSX fragment
You are able to a component aside from Work.Fragment by altering the newest JSX fragment. Such as for instance, to use new role Fragment instead (that is used from the almost every OneNightFriend login other libraries instance Preact):
Alternatively, if you are using TypeScript, you can just configure JSX to own TypeScript with the addition of which in order to your own tsconfig.json file and esbuild will be pick it up instantly without needing as set up:
#Remain brands
Into the JavaScript the name possessions towards properties and you can groups non-payments so you can a nearby identifier in the provider code. This type of sentence structure versions ready to go title assets of your function so you’re able to “fn” :
not, minification renames signs to reduce code proportions and you will bundling sometimes you need to help you rename symbols to quit collisions. You to alter worth of title possessions for almost all of them cases. Normally great because the name house is typically merely useful for debugging. But not, specific architecture rely on the name possessions to possess registration and binding motives. If this is the situation, you could potentially allow this one to preserve the initial title viewpoints inside minified password:
#Judge statements
A beneficial “legal comment” is considered to be people declaration-peak comment in the JS or code-level opinion into the CSS that has or otherwise one begins with //! otherwise /*! . Such comments try maintained during the productivity data files automatically due to the fact you to definitely follows this new intention of one’s amazing authors of password. But not, it behavior are going to be configured by using one of several following options:
The fresh new standard choices was eof when plan try enabled and you can inline if you don’t. Function the brand new judge review means looks like so it:
Remember that “statement-level” for JS and you may “rule-level” getting CSS function the new review need to can be found in a perspective in which numerous comments otherwise regulations are permitted eg regarding most readily useful-height extent or perhaps in a statement or code cut off. Thus comments in to the expressions or from the statement height aren’t noticed licenses comments.