I’m serving a website from a $1 ESP32 which has very little free flash so I need to make it as tiny as possible. Loading all of my packages from a CDN is the best way to achieve this. My site is also gziped.
build: {
rollupOptions: {
external: ['vue', 'vue-router', 'pinia', 'vuetify', 'webfontloader', 'core-js', 'vuetify/styles'],
output: {
paths: {
'vue-router': 'https://cdn.jsdelivr.net/npm/[email protected]/dist/vue-router.global.min.js',
vue: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.global.min.js',
pinia: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/pinia.iife.min.js',
vuetify: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.js',
'vuetify/styles': 'https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css',
webfontloader: 'https://cdn.jsdelivr.net/npm/[email protected]/webfontloader.min.js',
'core-js': 'https://cdn.jsdelivr.net/npm/[email protected]/proposals/reflect-metadata.min.js',
}
}
}
},
When I analyze the map of my app ‘vuetify/lib’ is still getting copied into it. How do I convince vite to load ‘vuetify/lib’ from the CDN? I tried making a rollupOptions external entry for ‘vuetify/lib’ and that didn’t change anything.
2