|
12 | 12 |
|
13 | 13 | const parseRuntime = require('../lib/config/parse-runtime'); |
14 | 14 | const context = require('../lib/context'); |
15 | | -const chalk = require('chalk'); |
| 15 | +const pc = require('picocolors'); |
16 | 16 | const logger = require('../lib/logger'); |
17 | 17 |
|
18 | 18 | const runtimeConfig = parseRuntime( |
@@ -41,7 +41,7 @@ if (indexPublicArgument !== -1) { |
41 | 41 |
|
42 | 42 | if (!runtimeConfig.isValidCommand) { |
43 | 43 | if (runtimeConfig.command) { |
44 | | - console.log(chalk.bgRed.white(`Invalid command "${runtimeConfig.command}"`)); |
| 44 | + console.log(pc.bgRed(pc.white(`Invalid command "${runtimeConfig.command}"`))); |
45 | 45 | console.log(); |
46 | 46 | } |
47 | 47 | showUsageInstructions(); |
@@ -72,26 +72,26 @@ if (runtimeConfig.useDevServer) { |
72 | 72 | function showUsageInstructions() { |
73 | 73 | const validCommands = ['dev', 'prod', 'production', 'dev-server']; |
74 | 74 |
|
75 | | - console.log(`usage ${chalk.green('encore')} [${ validCommands.map(command => chalk.green(command)).join('|') }]`); |
| 75 | + console.log(`usage ${pc.green('encore')} [${ validCommands.map(command => pc.green(command)).join('|') }]`); |
76 | 76 | console.log(); |
77 | 77 | console.log('encore is a thin executable around the webpack or webpack-dev-server executables'); |
78 | 78 | console.log(); |
79 | 79 | console.log('Commands:'); |
80 | | - console.log(` ${chalk.green('dev')} : runs webpack for development`); |
| 80 | + console.log(` ${pc.green('dev')} : runs webpack for development`); |
81 | 81 | console.log(' - Supports any webpack options (e.g. --watch)'); |
82 | 82 | console.log(); |
83 | | - console.log(` ${chalk.green('dev-server')} : runs webpack-dev-server`); |
84 | | - console.log(` - ${chalk.yellow('--host')} The hostname/ip address the webpack-dev-server will bind to`); |
85 | | - console.log(` - ${chalk.yellow('--port')} The port the webpack-dev-server will bind to`); |
86 | | - console.log(` - ${chalk.yellow('--keep-public-path')} Do not change the public path (it is usually prefixed by the dev server URL)`); |
87 | | - console.log(` - ${chalk.yellow('--public')} The public url for entry asset in entrypoints.json`); |
| 83 | + console.log(` ${pc.green('dev-server')} : runs webpack-dev-server`); |
| 84 | + console.log(` - ${pc.yellow('--host')} The hostname/ip address the webpack-dev-server will bind to`); |
| 85 | + console.log(` - ${pc.yellow('--port')} The port the webpack-dev-server will bind to`); |
| 86 | + console.log(` - ${pc.yellow('--keep-public-path')} Do not change the public path (it is usually prefixed by the dev server URL)`); |
| 87 | + console.log(` - ${pc.yellow('--public')} The public url for entry asset in entrypoints.json`); |
88 | 88 | console.log(' - Supports any webpack-dev-server options'); |
89 | 89 | console.log(); |
90 | | - console.log(` ${chalk.green('production')} : runs webpack for production`); |
| 90 | + console.log(` ${pc.green('production')} : runs webpack for production`); |
91 | 91 | console.log(' - Supports any webpack options (e.g. --watch)'); |
92 | 92 | console.log(); |
93 | | - console.log(chalk.yellow(' encore dev --watch')); |
94 | | - console.log(chalk.yellow(' encore dev-server')); |
95 | | - console.log(chalk.yellow(' encore production')); |
| 93 | + console.log(pc.yellow(' encore dev --watch')); |
| 94 | + console.log(pc.yellow(' encore dev-server')); |
| 95 | + console.log(pc.yellow(' encore production')); |
96 | 96 | console.log(); |
97 | 97 | } |
0 commit comments