0

I have downloaded https://github.com/primefaces/sakai-vue. I want to build the project with npm run build just out of the box after a clean download and follow the documentation.

I have modified vite.config.js as follows:

/**
 *  Some tips on:
 * -- https://vitejs.dev/config/
 * -- https://stackoverflow.com/questions/72005194/vue-3-vite-built-application-shows-blank-page
 * 
 *  */

import { fileURLToPath, URL } from 'node:url';

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

export default defineConfig(({ command }) => {
    return {
        plugins: [vue()],
---->       base: command === 'serve' ? '' : '',
        resolve: {
            alias: {
                '@': fileURLToPath(new URL('./src', import.meta.url))
            }
        }
    };
});

I want a dist folder on the same app directory. So far I get this after run build:

├── assets
├── demo
├── favicon.ico
├── index.html
├── layout
├── themes
└── upload.php

My index.html points to the right CSS and media files.

If I run npm run dev, I get I can see the login page on http://localhost:5173/#/auth/login:

--- main.js ---
...
app.use(router);
router.push({ name: "login" }); 
...

but I cannot find the way to find the same from the index.html file after running npm run build.

What Am I missing? How can I do it? How can the default page for build be set?

Javi M
  • 97
  • 9
  • 1
    the build files generated by `npm run build` are meant to be hosted and served from an HTTP server. You will need to host the files on a server like IIS or node or an online service like netlify. See the [documentation](https://vitejs.dev/guide/static-deploy.html) on different ways to deploy. – yoduh Feb 28 '23 at 22:10

0 Answers0