tree shake vuetify imports to minimise bundle size

This commit is contained in:
liamcottle
2024-12-26 14:53:52 +13:00
parent 178cfde6c8
commit b8725350c6
4 changed files with 45 additions and 9 deletions

44
package-lock.json generated
View File

@@ -24,6 +24,7 @@
"vis-data": "^7.1.9",
"vis-network": "^9.1.9",
"vite": "^6.0.5",
"vite-plugin-vuetify": "^2.0.4",
"vue-router": "^4.5.0",
"vuetify": "^3.7.6"
},
@@ -1537,6 +1538,18 @@
"integrity": "sha512-q0xCiLkuWWQLzVrecPb0RMsNWyxICOjPrcrwxTUEHb1fsnvni4dcuyG7RT/Ie7VPTvnjzIaWzRMUBsrqNj/hhw==",
"peer": true
},
"node_modules/@vuetify/loader-shared": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@vuetify/loader-shared/-/loader-shared-2.0.3.tgz",
"integrity": "sha512-Ss3GC7eJYkp2SF6xVzsT7FAruEmdihmn4OCk2+UocREerlXKWgOKKzTN5PN3ZVN5q05jHHrsNhTuWbhN61Bpdg==",
"dependencies": {
"upath": "^2.0.1"
},
"peerDependencies": {
"vue": "^3.0.0",
"vuetify": "^3.0.0"
}
},
"node_modules/@xmldom/xmldom": {
"version": "0.8.10",
"resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz",
@@ -2538,7 +2551,6 @@
"version": "4.3.6",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz",
"integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==",
"dev": true,
"dependencies": {
"ms": "2.1.2"
},
@@ -4260,8 +4272,7 @@
"node_modules/ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/mz": {
"version": "2.7.0",
@@ -5503,6 +5514,15 @@
"node": ">= 4.0.0"
}
},
"node_modules/upath": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz",
"integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==",
"engines": {
"node": ">=4",
"yarn": "*"
}
},
"node_modules/update-browserslist-db": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz",
@@ -5697,6 +5717,24 @@
}
}
},
"node_modules/vite-plugin-vuetify": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/vite-plugin-vuetify/-/vite-plugin-vuetify-2.0.4.tgz",
"integrity": "sha512-A4cliYUoP/u4AWSRVRvAPKgpgR987Pss7LpFa7s1GvOe8WjgDq92Rt3eVXrvgxGCWvZsPKziVqfHHdCMqeDhfw==",
"dependencies": {
"@vuetify/loader-shared": "^2.0.3",
"debug": "^4.3.3",
"upath": "^2.0.1"
},
"engines": {
"node": "^18.0.0 || >=20.0.0"
},
"peerDependencies": {
"vite": ">=5",
"vue": "^3.0.0",
"vuetify": "^3.0.0"
}
},
"node_modules/vue": {
"version": "3.4.38",
"resolved": "https://registry.npmjs.org/vue/-/vue-3.4.38.tgz",

View File

@@ -109,6 +109,7 @@
"vis-data": "^7.1.9",
"vis-network": "^9.1.9",
"vite": "^6.0.5",
"vite-plugin-vuetify": "^2.0.4",
"vue-router": "^4.5.0",
"vuetify": "^3.7.6"
}

View File

@@ -10,12 +10,7 @@ import App from './components/App.vue';
// init vuetify
import 'vuetify/styles';
import { createVuetify } from 'vuetify';
import * as components from 'vuetify/components';
import * as directives from 'vuetify/directives';
const vuetify = createVuetify({
components,
directives,
})
const vuetify = createVuetify();
// provide axios globally
window.axios = axios;

View File

@@ -1,10 +1,12 @@
import path from "path";
import vue from '@vitejs/plugin-vue';
import vuetify from 'vite-plugin-vuetify';
export default {
plugins: [
vue(),
vuetify(),
],
// vite app is loaded from /src/frontend