Build for production
A JOPS app needs no compilation: the files you develop are the files you ship. The build step only collects them into a clean folder for deployment.
-
Make sure the vendored library matches the installed version:
Terminal window npx jops-core update -
Build:
Terminal window npm run buildnpx jops-core initadded this script topackage.json; it runsnpx jops-core build. -
Upload the
dist/folder to your server or static host.
What ends up in dist/
Section titled “What ends up in dist/”The build copies your project into dist/ and leaves out what the browser doesn’t need:
node_modules/,.git/and an earlierdist/package.json,package-lock.json,.gitignore,.npmrc- Markdown files (
.md), npm tarballs (.tgz) and logs (.log)
Everything else (index.html, lib/, src/, assets/) is copied as is. dist/ is replaced on every build.
If lib/jops-core.min.js differs from the version installed in node_modules, the build prints a warning and suggests running npx jops-core update first.
Deploying
Section titled “Deploying”dist/ is a set of static files: any web server or static host can serve it (Nginx, Apache, IIS, S3 with CloudFront, GitHub Pages and similar). Routes live in the URL hash (#home, #features), so the server never sees them and needs no rewrite rules.
Other platforms
Section titled “Other platforms”jops-core build is for web projects. Other project types use their own packaging tools: