Internet browser APIs and don’t use which naming meeting and this and prevents issues that have browser APIs

Internet browser APIs and don’t use which naming meeting and this and prevents issues that have browser APIs

Merely mangling properties one end in an underscore is a good heuristic because regular JS password doesn’t generally speaking include identifiers like that. If you wish to end mangling labels including __defineGetter__ you can consider utilizing a far more cutting-edge regular term like [^_]_$ (we.elizabeth. need certainly to trigger a non-emphasize accompanied by an enthusiastic emphasize).

It is another type of form in lieu of being the main minify means because it’s a hazardous conversion process that will not work on haphazard JavaScript password. They merely works in case the offered normal phrase matches each of the latest functions you want mangled and does not meets one of one’s properties you do not need mangled. In addition only performs if you don’t less than one products reference a mangled property ultimately. Such, it means you can not fool around with obj[prop] in order to resource a property in which prop was a sequence with the brand new possessions term. Especially next syntax constructs may be the just of these qualified to receive possessions mangling:

When using this feature, understand that assets names are YetiЕџkin Гјcretsiz ve tek tanД±Еџma sitesi merely consistently mangled contained in this just one esbuild API name however around the esbuild API calls. For each esbuild API phone call really does another possessions mangling procedure so output data from one or two more API phone calls es, that could result in the resulting password to act improperly.

#Quoted services

By default, esbuild doesn’t modify the contents of string literals. This means you can avoid property mangling for an individual property by quoting it as a string. However, you must consistently use quotes or no quotes for a given property everywhere for this to work. For example, print(< foo_:>.foo_) will be mangled into print(< a:>.a) while print(< 'foo_':>[‘foo_’]) will not be mangled.

If you would like having esbuild to help you as well as mangle new material out-of sequence literals, you might explicitly allow that behavior such as this:

#Preventing renaming

If you prefer to exclude certain attributes of mangling, you might set-aside all of them with an extra form. Including, it uses the standard expression ^__.*__$ to set aside most of the features one begin and prevent that have a few underscores, like __foo__ :

#Persisting renaming choices

State-of-the-art use of the property mangling function comes to storage the latest mapping out-of completely new term in order to mangled title inside the a long-term cache. When let, all the mangled possessions renamings try submitted on cache when you look at the 1st generate. Next produces reuse the renamings kept in brand new cache and you will create more renamings for all the recently-added functions. It’s several consequences:

Brand new cache serves as a list of all the attributes that have been mangled. You can easily scan they to see if you’ll find any unanticipated assets renamings.

You could potentially disable mangling getting individual functions by setting new renamed really worth in order to not the case in lieu of in order to a set. This might be similar to the reserve props function however, towards an excellent per-possessions basis.

You could make sure uniform renaming ranging from generates (elizabeth.g. a main-thread file and a web worker, otherwise a library and you may a plug-in). Instead of this particular aspect, per make would do a separate renaming operation while the mangled possessions brands probably would not be uniform.

Whenever we want customRenaming_ become rebranded to cR_ and now we don’t want disabledRenaming_ is rebranded anyway, we can violation the second mangle cache JSON in order to esbuild:

#Metafile

This 1 tells esbuild which will make specific metadata in regards to the build in JSON format. Another analogy puts the metadata from inside the a file called meta.json :

This information are able to feel reviewed by the other equipment. Such as for instance, plan buddy is also eat esbuild’s metadata format and you will stimulates an excellent treemap visualization of the modules on your own package and just how far room each of them occupies.

Geplaatst in yetiskin-tarihleme-siteleri Siteler.

Geef een reactie