vuetifyjs / vuetify-loader

📦 Webpack and Vite plugins for treeshaking Vuetify components and more
https://vuetifyjs.com/customization/a-la-carte#vuetify-loader
MIT License
511 stars 91 forks source link

vite-plugin-vuetify 1.0.2 deprecated in Vite 5.0 & removed in v6 #320

Closed JensVanhulst closed 10 months ago

JensVanhulst commented 10 months ago

Screenshot 2023-11-17 at 10 20 41

https://vitejs.dev/guide/troubleshooting.html#cjs

donalmurtagh commented 10 months ago

Common JS is deprecated in Vite 5 and will be removed in Vite 6. When you use this plugin in Vite 5 it shows a warning to this effect on the console, but the plugin does work in Vite 5.

To make the plugin compatible with Vite 6, an ESM version is needed

hrobertson commented 10 months ago

I have "type": "module" in my package.json so vite.config.ts is treated as an ES module. Using Typescript 5.2.2 I'm getting this error on my use of vite-plugin-vuetify:

import vuetify from "vite-plugin-vuetify";
const vuetifyPlugins = vuetify({ autoImport: true }),

This expression is not callable. Type 'typeof import("/home/hamish/my-project/node_modules/vite-plugin-vuetify/dist/index")' has no call signatures.ts(2349)

Strangely builds seem to be working for now but my project is still WIP so I might yet encounter issues.

Ultimately an ESM version of this package is needed as @donalmurtagh has said.