Most SPAs declare a build command in the
scripts array of the project’s
package.json file. To run this script in Netlify, set the Build command to
npm run YOUR_BUILD_SCRIPT or
The Publish directory for single-page apps is often called
dist but varies by framework and build tool. You can check the framework documentation, or try running the build script locally, then check what folder was created as a result.
If your app uses history pushstate to get clean URLs, you must add a rewrite rule to serve the
index.html file no matter what URL the browser requests.
# More build configuration resources
Did you find this doc useful?
Your feedback helps us improve our docs.