Unverified Commit e3e76a45 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Add experimental compile/generate handling (#49491)

This implements experimental`compile`/`generate` commands to allow
separate the compilation and static generation steps of the build.
Initially this is for testing and follows same experimental rules which
aren't covered by semver.

Note: most changes are just spacing changes so disabling that in the
diff will be helpful.

x-ref: [initial
thread](https://www.notion.so/vercel/bbdbba2016ed464eb5263d325fecc02f?pvs=4)
x-ref: [slack
thread](https://vercel.slack.com/archives/C03DQ3QFV7C/p1676591260523589?thread_ts=1676554904.334789&cid=C03DQ3QFV7C)
parent ef2b8f86
...@@ -62,6 +62,11 @@ if (!foundCommand && args['--help']) { ...@@ -62,6 +62,11 @@ if (!foundCommand && args['--help']) {
} }
const command = foundCommand ? args._[0] : defaultCommand const command = foundCommand ? args._[0] : defaultCommand
if (['experimental-compile', 'experimental-generate'].includes(command)) {
args._.push('--build-mode', command)
}
const forwardedArgs = foundCommand ? args._.slice(1) : args._ const forwardedArgs = foundCommand ? args._.slice(1) : args._
if (args['--inspect']) if (args['--inspect'])
......
This diff is collapsed.
...@@ -18,6 +18,7 @@ const nextBuild: CliCommand = (argv) => { ...@@ -18,6 +18,7 @@ const nextBuild: CliCommand = (argv) => {
'--no-mangling': Boolean, '--no-mangling': Boolean,
'--experimental-app-only': Boolean, '--experimental-app-only': Boolean,
'--experimental-turbo': Boolean, '--experimental-turbo': Boolean,
'--build-mode': String,
// Aliases // Aliases
'-h': '--help', '-h': '--help',
'-d': '--debug', '-d': '--debug',
...@@ -78,7 +79,8 @@ const nextBuild: CliCommand = (argv) => { ...@@ -78,7 +79,8 @@ const nextBuild: CliCommand = (argv) => {
!args['--no-lint'], !args['--no-lint'],
args['--no-mangling'], args['--no-mangling'],
args['--experimental-app-only'], args['--experimental-app-only'],
args['--experimental-turbo'] args['--experimental-turbo'],
args['--build-mode'] || 'default'
).catch((err) => { ).catch((err) => {
console.error('') console.error('')
if ( if (
......
...@@ -9,4 +9,8 @@ export const commands: { [command: string]: () => Promise<CliCommand> } = { ...@@ -9,4 +9,8 @@ export const commands: { [command: string]: () => Promise<CliCommand> } = {
telemetry: () => telemetry: () =>
Promise.resolve(require('../cli/next-telemetry').nextTelemetry), Promise.resolve(require('../cli/next-telemetry').nextTelemetry),
info: () => Promise.resolve(require('../cli/next-info').nextInfo), info: () => Promise.resolve(require('../cli/next-info').nextInfo),
'experimental-compile': () =>
Promise.resolve(require('../cli/next-build').nextBuild),
'experimental-generate': () =>
Promise.resolve(require('../cli/next-build').nextBuild),
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment