netlify-cli
Version:
Netlify command line tool
18 lines • 1.19 kB
JavaScript
import process from 'process';
import { normalizeContext } from '../../utils/env/index.js';
export const createBuildCommand = (program) => program
.command('build')
.description('Build on your local machine')
.option('--context <context>', 'Specify a deploy context for environment variables read during the build (”production”, ”deploy-preview”, ”branch-deploy”, ”dev”) or `branch:your-branch` where `your-branch` is the name of a branch (default: value of CONTEXT or ”production”)', normalizeContext, process.env.CONTEXT || 'production')
.option('--dry', 'Dry run: show instructions without running them', false)
.option('-o, --offline', 'Disables any features that require network access')
.addExamples([
'netlify build',
'netlify build --context deploy-preview # Build with env var values from deploy-preview context',
'netlify build --context branch:feat/make-it-pop # Build with env var values from the feat/make-it-pop branch context or branch-deploy context',
])
.action(async (options, command) => {
const { build } = await import('./build.js');
await build(options, command);
});
//# sourceMappingURL=index.js.map