Reputation: 4705
When I create a fresh vue-cli
project via this command
vue create hello-word
and this command to install vuetify
vue add vuetify
Then I saw my git changes like this
Two new dependencies have been installed in package.json
.
vue-cli-plugin-vuetify
vuetify-loader
At first glance, I thought vue.config.js
has specified using these two, but it's content only have these code.
module.exports = {
"transpileDependencies": [
"vuetify"
]
}
So, how does vue-cli
know I've installed this new vuetify loader?
Does it automatically pick those up?
Upvotes: 2
Views: 3998
Reputation: 3411
After running vue add vuetify
choose Vuetify 3 if you are using Vue 3:
Upvotes: 1
Reputation: 973
vuetify-loader is a treeshaking plugin for Webpack. It gets installed automatically when you install Vuetify using "vue add vuetify".
So, vuetify-loader is used by Webpack for treeshaking the Vuetify components to only include the ones that you imported in your app. This way Webpack should be able to lower your build size by importing only the required components, and not all the Vuetify components.
And this is the vuetify-loader project on Github
Upvotes: 0