What @coelmay is trying to tell you is that, you can’t run a server on Netlify. What your command is doing is that, it’s starting a development server and the build never finishes. it eventually times out.
Instead, what you need is a command to build a production version - something that will output the required files and the command would exit. After this happens, Netlify will deploy your website. In webpack, the command might be something along the lines of webpack-cli build.
I see, thanks for the clarification! I now have a "build": "webpack --mode production", command and changed the Publish directory to the dist folder that the build command produces, and it successfully deploys, but the site still gets a page not found error. the build command requires a index.js file, which gives me a You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file error if I try to put react code in it, which is needed to display the proper page. I have my babel-loader in a common.js file which the webpack should be able to read, but I’m not sure why it’s not picking it up. any ideas anyone?
so there’s a index.html file in the src/ directory, but with react apps it’s the index.js file that holds all the content. this is my directory tree. my build command is npm run build
but am i missing something? Screen Shot 2021-07-06 at 6.33.58 PM294×623 18.7 KB
It uses webpack-dev-server for testing and webpack for building.
I hope this may help you progress with your project and get a successful build & deploy.
The node-gyp thing won’t install. It’s not the first time though, I have always had problems getting that to install when testing anyone’s repo. Probably something wrong with my config. I just never tried solving it.
For the time-being, did you try @coelmay’s suggestion?