build: add vue-router.esm-browser.prod.js #2242
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.
Based on #1847.
Currently we have
vue-router.esm-browser.js
, but there isn't a production version of that file.The key benefits of the newly added
vue-router.esm-browser.prod.js
are:@vue/devtools-api
.That second point is important, as various CDNs can automatically apply the minification, but they can't strip out the dependency on
@vue/devtools-api
.The
moduleSideEffects: false
setting is responsible for ensuring@vue/devtools-api
is removed. Without that, we end up withimport "@vue/devtools-api"
in the built file. See https://rollupjs.org/configuration-options/#treeshake-modulesideeffects for details of that setting. While the setting is being applied to all builds, none of the other builds are actually impacted in practice.Do we actually need a production build for
esm-browser
? Not sure, but based on the comments on #1847 and #2241, it does seem that some people would find it useful. An equivalent file is already provided by both Vue Router 3 and Vue core.Closes #1847.