Unverified Commit ee2bdb89 authored by Joe Haddad's avatar Joe Haddad Committed by GitHub

Avoid lambda nomenclature when `target != 'serverless'` (#7650)

parent 353e5051
...@@ -443,5 +443,9 @@ export default async function build(dir: string, conf = null): Promise<void> { ...@@ -443,5 +443,9 @@ export default async function build(dir: string, conf = null): Promise<void> {
await flyingShuttle.save(allStaticPages, pageInfos) await flyingShuttle.save(allStaticPages, pageInfos)
} }
printTreeView(Object.keys(allMappedPages), allPageInfos) printTreeView(
Object.keys(allMappedPages),
allPageInfos,
target === 'serverless'
)
} }
...@@ -37,7 +37,8 @@ export interface PageInfo { ...@@ -37,7 +37,8 @@ export interface PageInfo {
export function printTreeView( export function printTreeView(
list: string[], list: string[],
pageInfos: Map<string, PageInfo> pageInfos: Map<string, PageInfo>,
serverless: boolean
) { ) {
const getPrettySize = (_size: number): string => { const getPrettySize = (_size: number): string => {
const size = prettyBytes(_size) const size = prettyBytes(_size)
...@@ -73,7 +74,9 @@ export function printTreeView( ...@@ -73,7 +74,9 @@ export function printTreeView(
? ' ' ? ' '
: pageInfo && pageInfo.static : pageInfo && pageInfo.static
? chalk.bold('⚡') ? chalk.bold('⚡')
: 'λ' : serverless
? 'λ'
: 'σ'
} ${item}`, } ${item}`,
...(pageInfo ...(pageInfo
? [ ? [
...@@ -104,13 +107,21 @@ export function printTreeView( ...@@ -104,13 +107,21 @@ export function printTreeView(
console.log( console.log(
textTable( textTable(
[ [
[ serverless
'λ', ? [
'(Lambda)', 'λ',
`page was emitted as a lambda (i.e. ${chalk.cyan( '(Lambda)',
'getInitialProps' `page was emitted as a lambda (i.e. ${chalk.cyan(
)})`, 'getInitialProps'
], )})`,
]
: [
'σ',
'(Server)',
`page will be server rendered (i.e. ${chalk.cyan(
'getInitialProps'
)})`,
],
[ [
chalk.bold('⚡'), chalk.bold('⚡'),
'(Static File)', '(Static File)',
......
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