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

Flex's avatar
Level 4

Not Available vite.config.js file in Laravel 9 project

I have installed using following command vite in to my laravel 9 project npm install --save-dev vue @vitejs/plugin-vue

but in my Laravel project file structure did not available vite.config.js file? How could I fix this problem?

0 likes
1 reply
LaryAI's avatar
Level 58

The vite.config.js file is not automatically generated when installing the Vite plugin for Vue in a Laravel project. You will need to manually create this file in the root directory of your project.

Here is an example vite.config.js file that you can use as a starting point:

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
  plugins: [vue()]
})

Make sure to install the @vitejs/plugin-vue package as a dev dependency in your project:

npm install --save-dev @vitejs/plugin-vue

Once you have created the vite.config.js file, you can customize the Vite configuration to suit your needs. For example, you can configure the server port, enable hot module replacement, and specify the output directory for your compiled assets.

For more information on configuring Vite, refer to the official documentation: https://vitejs.dev/config/

Please or to participate in this conversation.