On Windows 10, I open Powershell and run npm create vue@latest
, choose No
for all options and then open the vue project in vscode.
Without any changes to the project I run npm install
and npm run dev
in the terminal, if I click on the link created, I see the default vuejs template project in the browser:
However, if I run npm run build
and then go to the dist
folder and open the created indext.html
file in the browser I only get a blank page:
It seems something does not work quite right with the paths on Windows, however so far I only managed to let the favicon in the header show up on the published build by changing vite.config.js
as follows:
// https://vitejs.dev/config/
export default defineConfig({
base: './', // adding this line let's the favicon show up
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})
What could be the issue here?