Install Vite
Do note that In order to use this module, the NuxtJs version has to be >= 2.15.0.
Do note that In order to use this module, the NuxtJs version has to be >= 2.15.0.
npm i -D nuxt-vite
yarn add --dev nuxt-vite
Update nuxt.config.js
Once it's installed, update the config buildModules property and add "nuxt-vite".
const config = { /* other configs omitted */ buildModules: [ 'nuxt-vite' ] } export default config
const config = { /* other configs omitted */ buildModules: [ 'nuxt-vite' ], vite: { /* options for vite */ vue: { /* options for vite-plugin-vue2 */ }, } } export default config
Run the Project
Now you can run "yarn dev" and now NuxtJs will be running with Vite. Many of the core functionalities are already supported so by right it will run smoothly unless if there are many modules used within the application and those modules have not been migrated.
Common Issues?
Do check out their main Github repository (NuxtJs Vite repository) as it's frequently being developed and you can also refer to this page for more details.
Thank you for reading this article and if you find it interesting do share it with others. Have fun experimenting and happy coding.