This condition is productive in the event the transfer roadway is actually regarding an ESM transfer report or transfer() term. It can be utilized to provide ESM-specific password.
This condition is only energetic in the event that import highway is out-of an effective CommonJS need() label. It can be utilized to include CommonJS-specific code.
This problem is productive when esbuild’s platform form is set to help you browser . It can be utilized to provide web browser-specific password.
This condition is effective whenever esbuild’s platform means is decided so you’re able to node . It can be used to include node-certain password.
Keep in mind that if you use the new need and import conditions, your bundle may end up regarding the plan several times! This is certainly a subdued thing that can cause pests on account of content duplicates of your own code’s condition also water retention the fresh resulting bundle. It is commonly known as the newest dual package possibilities. The key technique for to prevent this is to place each one of your code throughout the want condition and also have the transfer position you should be a light wrapper you to definitely calls require on your package and you will re-exports the box having fun with ESM syntax.
Which says to esbuild so you can edit their provider code ahead of strengthening to lose certain constructs. Discover currently several you’ll points that is going to be decrease:
Passageway which banner factors every debugger comments as taken out of brand new production. This really is just like the lose_debugger: genuine flag in the popular UglifyJS and Terser JavaScript minifiers.
JavaScript’s debugger comments cause the energetic debugger to relieve brand new statement given that an instantly-designed breakpoint. Password that has it declaration usually automatically end up being paused if the debugger is actually discover. When the no debugger is actually discover, the brand new report does little. Losing such statements from the code simply suppresses the fresh debugger regarding automatically closing in case the code operates.
- system
This may end up in this type of API phone calls to-be got rid of securely whenever minification is actually allowed
Passage which banner factors most of the console API calls to get eliminated regarding efficiency. This is just as the miss_console: genuine banner available in the favorite UglifyJS and you can Terser JavaScript minifiers.
WARNING: Using this type of flag is expose best mormon chat room insects to your code! It flag takes away the complete phone call expression as well as all of the label objections. If any of those objections got crucial side effects, with this particular flag will vary the fresh new choices of the code. End up being cautious while using the so it banner.
Should you want to beat unit API phone calls in place of removing the new arguments with harmful effects (you do not expose pests), you will want to ple, you could potentially mark console.diary while the natural having fun with –pure: console.record .
#Admission brands
This package controls the fresh new document names of yields data involved every single enter in access point file. It configures the output paths having fun with a layout that have placeholders one to might be substituted that have viewpoints particular towards the file in the event the efficiency highway is generated. Eg, specifying an admission term template regarding [dir]/ [name]- [hash] boasts an excellent hash of your production file on file identity and you may places the fresh records on the yields index, possibly significantly less than an effective subdirectory (see the information about [dir] below). Starting that appears along these lines:
Here is the cousin road on the list with which has the fresh input access point file with the outbase index. Their mission is to try to help you end accidents anywhere between identically-named admission activities in different subdirectories.
Such as, if the there’s two entryway points src/ pages/ home/ list.ts and you may src/ pages/ about/ index.ts , new outbase directory try src , therefore the entryway labels theme is [dir]/[name] , brand new efficiency list commonly consist of pages/ home/ list.js and you may users/ about/ directory.js . If your entry brands layout had been just [name] rather, bundling will have failed as there might have been two productivity data with the exact same productivity roadway index.js when you look at the output list.