Netlify is our absolute favorite publishing tool for websites and prototypes: just create a repo, go to netlify, set your build commands and go live. We have used with with create-react-app, preact, gatsby, hexo, you name it, it works.
Well no problem! We will show you how to handle this today.
In your source repository, move all files you want to deploy to a directory other than the root. We will call it
./app directory, but you can use any name that works for you.
In the root directory, run
npm init if you have not done so already to create
package.json, add a script called build. Below is an example:
Create a new project from your repository.
Configure your “build” settings. As your build command use
npm run build. Publish directory is the directory you created earlier in step 1, with all the files you want to deploy.
Here is an example configuration:
Queue a build manually or commit a change to your repository to trigger a build. Then navigate to your freshly launched website to see the end result.
That is it! Happy Coding.