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