This problem is only active in the event that transfer road was off an enthusiastic ESM import report or import() phrase. It can be used to provide ESM-particular code.
This problem is active if the import street try away from a CommonJS wanted() phone call. It can be utilized to include CommonJS-specific password.
This condition is only productive when esbuild’s program means is decided so you can internet browser . It can be used to add web browser-specific code.
This problem is productive when esbuild’s platform setting is decided to help you node . You can use it to provide node-particular password.
Observe that if you utilize brand new want and you may transfer requirements, your package could end upwards regarding escort Wilmington NC plan several times! This might be a simple thing that can cause bugs because of copy duplicates of code’s condition including fluid retention the newest ensuing plan. It is popularly known as new dual package possibility. The main technique for to avoid this really is to place every one of your code on need status and have the transfer condition you should be a white wrapper one to phone calls require on your plan and you may re-exports the package playing with ESM sentence structure.
So it informs esbuild in order to edit the resource code in advance of strengthening to help you drop particular constructs. You’ll find currently two you can items that shall be decrease:
Passage which flag grounds all the debugger statements to be removed from brand new productivity. This can be just as the get rid of_debugger: real banner found in the favorite UglifyJS and Terser JavaScript minifiers.
JavaScript’s debugger comments cause the energetic debugger to treat this new declaration since an instantly-set up breakpoint. Password that contains that it declaration often automatically be paused if debugger are unlock. If zero debugger are discover, the fresh new declaration do absolutely nothing. Shedding this type of statements out of your password simply suppress new debugger out of automatically closing whether your code runs.
- system
This may end up in these API phone calls getting removed properly whenever minification try allowed
Passageway this flag explanations all unit API calls to get got rid of on yields. It is similar to the drop_console: real flag for sale in the popular UglifyJS and Terser JavaScript minifiers.
WARNING: With this banner is also establish bugs into your code! That it banner eliminates the whole phone call term including all name arguments. If any of those arguments had very important ill effects, with this particular flag varies brand new conclusion of the password. Feel careful while using the this flag.
If you would like cure system API calls versus removing the arguments which have ill-effects (which means you do not expose insects), you need to ple, you could potentially mark unit.log just like the natural having fun with –pure: console.journal .
#Entry names
That one controls the newest file labels of your own productivity documents associated to each type in entry point file. They configures the newest output routes having fun with a layout having placeholders you to might be substituted with opinions certain to the file in the event that yields street is made. Such as for instance, specifying an entrance name theme out-of [dir]/ [name]- [hash] has an effective hash of your own efficiency document from the file term and you will throws the latest data files towards the production index, possibly less than an excellent subdirectory (see the information regarding [dir] below). Creating that looks in this way:
This is basically the relative street regarding index containing the enter in entry point file toward outbase index. Its mission is to try to make it easier to prevent crashes between identically-called entry facts in different subdirectories.
Such as for example, in the event that there are 2 entry items src/ pages/ home/ index.ts and you may src/ pages/ about/ directory.ts , the brand new outbase list was src , in addition to admission names theme is actually [dir]/[name] , the production directory usually include profiles/ home/ list.js and profiles/ about/ index.js . If the entryway names template was actually simply [name] alternatively, bundling might have were not successful since there would-have-been a couple production records with similar efficiency street list.js inside the efficiency index.