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
namanOP10mo ago
this is the structure
Wonderbear
Wonderbear10mo ago
@naman Which builder do you exactly use?
naman
namanOP10mo ago
@Wonderbear not familiar, is there any way I can check?
Wonderbear
Wonderbear10mo 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
namanOP10mo ago
I'm using node @Wonderbear should I try using something like parcel?
Wonderbear
Wonderbear10mo 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
namanOP10mo 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
Wonderbear10mo ago
What exactly happens when you do npm run build?
naman
namanOP10mo ago
I added a vite.config file to tell it to include other html files, it worked for me
Wonderbear
Wonderbear10mo ago
Great, so its solved?
naman
namanOP10mo ago
it would only include html.index Yessir!
Wonderbear
Wonderbear10mo ago
👍
naman
namanOP10mo ago
Need to figure out why threejs is not working now lol
Wonderbear
Wonderbear10mo ago
Did you install threee js via npm?
naman
namanOP10mo ago
yes, it seems to be working in the local server however, just not on netlify
Wonderbear
Wonderbear10mo ago
Probably you also need to configure vite to include it?
naman
namanOP10mo ago
shouldn't it include the files I call automatically? wont that result in the entire threejs folder included?
Wonderbear
Wonderbear10mo ago
I honestly dont know
Want results from more Discord servers?
Add your server