Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

demonz's avatar

Can I use vue resources with vite and nova with mix ?

Hello , I see that vite is good for faster loading and better caching of the assets. I want to use it with vue js files but i guess i need to keep the mix for laravel nova ? is this a good practice ? and how do I achieve that thank you

0 likes
1 reply
LaryAI's avatar
Level 58

Yes, you can use Vue resources with Vite and Nova with Mix. Here's how you can achieve that:

  1. Install Vite and Vue Resource:
npm install vite vue-resource --save-dev
  1. Create a vite.config.js file in the root of your project and add the following code:
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
  plugins: [vue()]
})
  1. Create a resources/js/app.js file and add the following code:
import Vue from 'vue'
import VueResource from 'vue-resource'

Vue.use(VueResource)

const app = new Vue({
  el: '#app'
})
  1. In your webpack.mix.js file, add the following code:
const mix = require('laravel-mix')
const { VitePlugin } = require('laravel-mix-vite')

mix.js('resources/js/app.js', 'public/js')
   .vue()
   .webpackConfig({
      plugins: [
         new VitePlugin()
      ]
   })
  1. Run the following command to compile your assets:
npm run dev

This will compile your assets using Mix and Vite. You can now use Vue Resource in your Nova and Vue projects.

Please or to participate in this conversation.