Skip to content

Commit

Permalink
Configured vuetify a-la-carte to import specific components (low buil…
Browse files Browse the repository at this point in the history
…d size project)
  • Loading branch information
davidgaroro committed Aug 7, 2018
1 parent 1161242 commit d3deaae
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 3 deletions.
8 changes: 8 additions & 0 deletions babel.config.js
@@ -1,5 +1,13 @@
module.exports = {
presets: [
'@vue/app'
],
plugins: [
["transform-imports", {
"vuetify": {
"transform": "vuetify/es5/components/${member}",
"preventFullImport": true
}
}]
]
}
70 changes: 70 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -20,6 +20,7 @@
"@vue/cli-plugin-pwa": "^3.0.0-rc.10",
"@vue/cli-service": "^3.0.0-rc.10",
"@vue/eslint-config-standard": "^3.0.0-rc.10",
"babel-plugin-transform-imports": "^1.5.0",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"vue-template-compiler": "^2.5.16"
Expand Down
2 changes: 1 addition & 1 deletion src/main.js
@@ -1,9 +1,9 @@
import Vue from 'vue'
import './vuetify'
import App from './App.vue'
import router from './router'
import store from './store'
import './registerServiceWorker'
import './vuetify'

Vue.config.productionTip = false

Expand Down
31 changes: 29 additions & 2 deletions src/vuetify.js
@@ -1,9 +1,36 @@
import Vue from 'vue'
import Vuetify from 'vuetify'
import 'vuetify/dist/vuetify.min.css'
import 'vuetify/src/stylus/app.styl'
import manifestJSON from '../public/manifest.json'

import {
Vuetify,
VApp,
VBtn,
VBtnToggle,
VCard,
VCheckbox,
VDivider,
VGrid,
VIcon,
VList,
VProgressLinear,
VTextField
} from 'vuetify'

Vue.use(Vuetify, {
components: {
VApp,
VBtn,
VBtnToggle,
VCard,
VCheckbox,
VDivider,
VGrid,
VIcon,
VList,
VProgressLinear,
VTextField
},
theme: {
primary: manifestJSON.theme_color
}
Expand Down

0 comments on commit d3deaae

Please sign in to comment.