I wanted to test my website and build it. I read the Documentation and used Visual Studio Code and Vite
I used the commands to setup my project:
npm install --save three
npm install --save-dev vite
to view it locally:
npx vite
and to build:
npx vite build
My Project has several files. It has an index.html, portfolio.html, about-me.html and two css files.
For know I have in my portfolio site one main.js with THREE. js content.
Later I would like to add some project.htmls with other .js scripts.
How do I build this (to publish it on my server)? So it includes my whole project? If I use the “npx vite build” it creates a dist folder but only contains index.html and some assets ( I think all of the ones I use on the index), no css and no other stuff from my project.
you would typically use what is called a router instead of multiple html. this is called SPA (single page app). or you use a dedicated service like nextjs instead of vite, there you have file system routes and it is probably very close to what you already have.
thank you for the answer, I tried to understand what I should do… I am a little confused because I only have 1 of the pages with a js but the others dont like this: