Skip to content

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.

  1. Make sure the vendored library matches the installed version:

    Terminal window
    npx jops-core update
  2. Build:

    Terminal window
    npm run build

    npx jops-core init added this script to package.json; it runs npx jops-core build.

  3. Upload the dist/ folder to your server or static host.

The build copies your project into dist/ and leaves out what the browser doesn’t need:

  • node_modules/, .git/ and an earlier dist/
  • 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.

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.

jops-core build is for web projects. Other project types use their own packaging tools: