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