Skip to content

Conversation

@skirtles-code
Copy link
Contributor

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:

  1. It's minified.
  2. It doesn't have a dependency on @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 with import "@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.

@netlify
Copy link

netlify bot commented May 17, 2024

Deploy Preview for vue-router canceled.

Name Link
🔨 Latest commit 79f83dc
🔍 Latest deploy log https://app.netlify.com/sites/vue-router/deploys/6646da5689fd5c0008e24471

@codecov
Copy link

codecov bot commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.01%. Comparing base (d6d4dd3) to head (79f83dc).
Report is 96 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2242   +/-   ##
=======================================
  Coverage   91.01%   91.01%           
=======================================
  Files          24       24           
  Lines        1135     1135           
  Branches      351      351           
=======================================
  Hits         1033     1033           
  Misses         63       63           
  Partials       39       39           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this!

@posva posva merged commit 846e287 into vuejs:main Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants