diff --git a/packages/cli/src/utils/banner.js b/packages/cli/src/utils/banner.js index 9d0968904c..a9e5237fa2 100644 --- a/packages/cli/src/utils/banner.js +++ b/packages/cli/src/utils/banner.js @@ -20,7 +20,8 @@ export function showBanner (nuxt, showMemoryUsage = true) { const messageLines = [] // Name and version - titleLines.push(`${chalk.green.bold('Nuxt.js')} ${nuxt.constructor.version}`) + const { bannerColor } = nuxt.options.cli + titleLines.push(`${chalk[bannerColor].bold('Nuxt.js')} ${nuxt.constructor.version}`) // Running mode titleLines.push(`Running in ${nuxt.options.dev ? chalk.bold.blue('development') : chalk.bold.green('production')} mode (${chalk.bold(nuxt.options.mode)})`) diff --git a/packages/cli/test/unit/utils-minimalcli.test.js b/packages/cli/test/unit/utils-minimalcli.test.js index 3b9aa983d2..42427da11e 100644 --- a/packages/cli/test/unit/utils-minimalcli.test.js +++ b/packages/cli/test/unit/utils-minimalcli.test.js @@ -17,7 +17,9 @@ describe('cli/utils', () => { showBanner({ options: { - cli: {} + cli: { + bannerColor: 'green' + } }, server: { listeners diff --git a/packages/cli/test/unit/utils.test.js b/packages/cli/test/unit/utils.test.js index cf3537eb1c..5ce6e33fee 100644 --- a/packages/cli/test/unit/utils.test.js +++ b/packages/cli/test/unit/utils.test.js @@ -129,6 +129,7 @@ describe('cli/utils', () => { jest.spyOn(fmt, 'successBox').mockImplementation(successBox) const badgeMessages = [ 'badgeMessage' ] + const bannerColor = 'green' const listeners = [ { url: 'first' }, { url: 'second' } @@ -137,7 +138,8 @@ describe('cli/utils', () => { showBanner({ options: { cli: { - badgeMessages + badgeMessages, + bannerColor } }, server: { @@ -163,7 +165,8 @@ describe('cli/utils', () => { showBanner({ options: { cli: { - badgeMessages: [] + badgeMessages: [], + bannerColor: 'green' } }, server: { diff --git a/packages/config/src/config/cli.js b/packages/config/src/config/cli.js index 98a69fce50..88f6404b24 100644 --- a/packages/config/src/config/cli.js +++ b/packages/config/src/config/cli.js @@ -1,3 +1,4 @@ export default () => ({ - badgeMessages: [] + badgeMessages: [], + bannerColor: 'green' }) diff --git a/packages/config/test/__snapshots__/options.test.js.snap b/packages/config/test/__snapshots__/options.test.js.snap index e8798e12d7..6d2c98cd33 100644 --- a/packages/config/test/__snapshots__/options.test.js.snap +++ b/packages/config/test/__snapshots__/options.test.js.snap @@ -149,6 +149,7 @@ Object { "buildModules": Array [], "cli": Object { "badgeMessages": Array [], + "bannerColor": "green", }, "css": Array [], "debug": false, diff --git a/packages/config/test/config/__snapshots__/index.test.js.snap b/packages/config/test/config/__snapshots__/index.test.js.snap index 88799244b7..cb580ea01e 100644 --- a/packages/config/test/config/__snapshots__/index.test.js.snap +++ b/packages/config/test/config/__snapshots__/index.test.js.snap @@ -129,6 +129,7 @@ Object { "buildModules": Array [], "cli": Object { "badgeMessages": Array [], + "bannerColor": "green", }, "css": Array [], "debug": undefined, @@ -480,6 +481,7 @@ Object { "buildModules": Array [], "cli": Object { "badgeMessages": Array [], + "bannerColor": "green", }, "css": Array [], "debug": undefined,