diff --git a/packages/rollup/.eslintrc.json b/packages/rollup/.eslintrc.json index aee3b4f068455..c0f5b93586875 100644 --- a/packages/rollup/.eslintrc.json +++ b/packages/rollup/.eslintrc.json @@ -4,7 +4,15 @@ "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} + "rules": { + "no-restricted-imports": [ + "error", + { + "name": "chalk", + "message": "Please use `picocolors` in place of `chalk` for rendering terminal colors" + } + ] + } }, { "files": ["*.ts", "*.tsx"], diff --git a/packages/rollup/package.json b/packages/rollup/package.json index c854bd9d27a22..49745c4bf55b0 100644 --- a/packages/rollup/package.json +++ b/packages/rollup/package.json @@ -35,8 +35,8 @@ "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^15.2.3", "autoprefixer": "^10.4.9", - "chalk": "^4.1.0", "minimatch": "9.0.3", + "picocolors": "^1.1.0", "postcss": "^8.4.38", "rollup": "^4.14.0", "rollup-plugin-copy": "^3.5.0", diff --git a/packages/rollup/src/plugins/analyze.ts b/packages/rollup/src/plugins/analyze.ts index 74f64efcea36d..a4100169d973c 100644 --- a/packages/rollup/src/plugins/analyze.ts +++ b/packages/rollup/src/plugins/analyze.ts @@ -1,4 +1,4 @@ -import * as chalk from 'chalk'; +import * as pc from 'picocolors'; import { logger } from '@nx/devkit'; const formatBytes = (bytes) => { @@ -16,7 +16,7 @@ export function analyze() { renderChunk(source, chunk) { const sourceBytes = formatBytes(source.length); const fileName = chunk.fileName; - logger.info(` ${chalk.bold(fileName)} ${chalk.cyan(sourceBytes)}`); + logger.info(` ${pc.bold(fileName)} ${pc.cyan(sourceBytes)}`); }, }; }