including all html files in npm build package

Hey guys, it's my first time using npm to build a project (did this mainly to use threejs). When I run the command
npm run build
npm run build
only index.html is bundled in the package. I do not have a .gitignore or a .npmignore file. Am I doing something wrong?
No description
18 Replies
naman
namanOP11mo ago
this is the structure
Wonderbear
Wonderbear11mo ago
@naman Which builder do you exactly use?
naman
namanOP11mo ago
@Wonderbear not familiar, is there any way I can check?
Wonderbear
Wonderbear11mo ago
If you haven't installed a bundler via npm, then you dont use a bundler. Node and npm dont come with a bundler included. Do you use Node? Or Deno?
naman
namanOP11mo ago
I'm using node @Wonderbear should I try using something like parcel?
Wonderbear
Wonderbear11mo ago
If you want to bundle a frontend project, which I assume as you have an html file, I'd use Vite as my general development manager. Vite has a bundler included.
naman
namanOP11mo ago
I am using vite, but I am only able to get index.html to work on netlify @Wonderbear any idea what I could be doing wrong?
Wonderbear
Wonderbear11mo ago
What exactly happens when you do npm run build?
naman
namanOP11mo ago
I added a vite.config file to tell it to include other html files, it worked for me
Wonderbear
Wonderbear11mo ago
Great, so its solved?
naman
namanOP11mo ago
it would only include html.index Yessir!
Wonderbear
Wonderbear11mo ago
👍
naman
namanOP11mo ago
Need to figure out why threejs is not working now lol
Wonderbear
Wonderbear11mo ago
Did you install threee js via npm?
naman
namanOP11mo ago
yes, it seems to be working in the local server however, just not on netlify
Wonderbear
Wonderbear11mo ago
Probably you also need to configure vite to include it?
naman
namanOP11mo ago
shouldn't it include the files I call automatically? wont that result in the entire threejs folder included?
Wonderbear
Wonderbear11mo ago
I honestly dont know
Want results from more Discord servers?
Add your server