This condition is only energetic when the transfer roadway are out of an ESM transfer report or transfer() term. It can be used to incorporate ESM-specific code.
This condition is only effective when the transfer roadway is actually off a beneficial CommonJS need() label. It can be used to incorporate CommonJS-particular password.
This disorder is just effective when esbuild’s system means is decided to help you web browser . It can be used to provide internet browser-particular password.
This disorder is productive when esbuild’s system form is determined to help you node . It can be utilized to add node-particular password.
Note that if you use new want and you may import criteria, their bundle may end upwards regarding package multiple times! This might be a slight thing that cause bugs on account of content copies of one’s code’s county as well as water retention new ensuing bundle. This https://datingmentor.org/escort/montgomery/ can be commonly known as the latest dual bundle possibilities. The primary way of to stop this is certainly to place each one of the code regarding wanted status and also have the transfer standing just be a white wrapper you to definitely calls want in your bundle and you may lso are-exports the box having fun with ESM sentence structure.
It informs esbuild to edit their source code prior to strengthening so you can get rid of certain constructs. You’ll find currently a few possible issues that would be fell:
Passage that it flag reasons all the debugger comments is removed from the fresh efficiency. This is certainly much like the lose_debugger: true flag obtainable in the popular UglifyJS and you will Terser JavaScript minifiers.
JavaScript’s debugger comments result in the effective debugger to alleviate the latest statement because the an automatically-designed breakpoint. Password that has had this declaration tend to automatically be paused in the event the debugger is actually unlock. In the event the no debugger is actually unlock, brand new declaration do little. Losing this type of comments out of your password just prevents the brand new debugger out-of automatically stopping in the event your password runs.
Passage which flag factors all unit API phone calls is removed throughout the output. This might be much like the drop_console: genuine banner in the popular UglifyJS and you can Terser JavaScript minifiers.
WARNING: Using this banner normally present pests into your password! This banner takes away the whole name term and additionally every telephone call objections. Or no of those objections had essential side effects, with this specific flag will be different the brand new choices of the code. Getting cautious while using the this flag.
Should you want to lose system API phone calls in the place of removing the brand new arguments which have side effects (you do not introduce insects), you really need to ple, you could mark unit.record just like the absolute using –pure: console.journal .
This option regulation the newest document brands of your returns documents associated to each and every input entry way document. They configures brand new productivity pathways using a layout having placeholders that is replaced which have values certain into file if returns road is done. Particularly, indicating an entry title theme off [dir]/ [name]- [hash] comes with a great hash of the production document from the file label and puts the documents into the productivity index, potentially less than a great subdirectory (comprehend the factual statements about [dir] below). Undertaking that appears such as this:
This is basically the relative path from the list containing the new input entry point document on outbase directory. The objective is always to help you end collisions between identically-named entryway items in various subdirectories.
Like, if the there are 2 entry affairs src/ pages/ home/ list.ts and you can src/ pages/ about/ directory.ts , the brand new outbase list was src , therefore the admission brands layout are [dir]/[name] , the newest returns index commonly consist of users/ home/ index.js and you will profiles/ about/ directory.js . In the event the entry brands layout is only [name] rather, bundling could have were unsuccessful as there could have been a couple efficiency documents with the same yields highway list.js from inside the production list.