Home > Software engineering >  How to use NPM run build?
How to use NPM run build?

Time:07-10

I created a vue3 website using Laravel 9 and Vue3. For the bundling of assets I am using the vite. So for the development is good , I made the app. Now I want to deploy it. I ran npm run build, it created a build folder in public. along with manifest.json

How am I gonna use it to make my application working on the live server ?

Below is the screenshot to file structure :

enter image description here

CodePudding user response:

I think you should have a third script in your package.json named preview

You should just run npm run preview, it will serve your local build

CodePudding user response:

If you use @vite([]) in the head section, it will automatically switch to the build css and js files since it notices that you are not running 'hot'.

So, if it works with the @vite blade helper in development then it should work in production

  • Related