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 is a proposal to enable Vuetify treeshaking.
This simple tweak reduces the total size of the
dist
directory ofWegue starter app
from 18.1MB to 14.5MB.Some technical difficulties are encountered with unit tests though once the
Vuetify loader
is installed. Please note that this issue also happens on a fresh app scaffolded withVue-CLI
. The way they get around this when generating an app from scratch is to putvuetify
in thetranspileDependencies
list, which is currently empty inWegue
by default.This transpile operation makes the bundle size to grow of 26.374 bytes with the starter app which is negligible, but also produces a warning:
[BABEL] Note: The code generator has deoptimised the styling of C:\Sources\Wegue\node_modules\vuetify\dist\vuetify.js as it exceeds the max of 500KB.
The only other way around I've found is to disable treeshaking once
NODE_ENV === 'test'
insidevue.config.js
. I haven't encountered problems in my personal applications with this yet but this should be tested on more apps I think...So this PR implements the second solution (disabling treeshaking during unit tests) but in case you'd like to test the other option, all what should be done is commenting out line 65 in
vue.config.js
and replacing line 75 of the same file byJust tell me whether treeshaking would be of an interest and what you think about this,
Cheers
Sébastien