set window target for minified build #685
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR doing 3 important things:
Taking in account that it's a browser-only library setting
globalObject: 'window'
for webpackRepointing
main
frompackage.json
to non-minified UMD version and ships minified version as bounded towindow
function, not as UMD module.Motivation here: if some developer are using this library via
import Choices from 'choices.js'
then that developer expect are non-minified version of the library to become part of his bundle (as they may debug something or apply different minifier later, for example Closure Compiler and existing minifying will hurt). This expectation particularly set by common sense and by the most popular Javascript library of all times.As result, coupled with upgraded
fuse.js
it decreases minified bundle size.Committed affected minified builded asset (we should get rid of them from repository, seriously :-) )