#!/usr/bin/env node import { resolve } from 'path' import parseArgs from 'minimist' import build from '../server/build' const argv = parseArgs(process.argv.slice(2), { alias: { h: 'help' }, boolean: ['h'] }) if (argv.help) { console.log(` Description Compiles the application for production deployment Usage $ next build represents where the compiled .next folder should go. If no directory is provided, .next will be created in the current directory `) process.exit(0) } const dir = resolve(argv._[0] || '.') build(dir) .catch((err) => { console.error(err) process.exit(1) })