From b770bc4d8839576a0864c7243b28fc2aa4b17825 Mon Sep 17 00:00:00 2001 From: leo60228 Date: Wed, 20 May 2020 13:21:30 -0400 Subject: [PATCH] Support silencing sourcemap warning --- src/rollup-plugin-prettier.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rollup-plugin-prettier.js b/src/rollup-plugin-prettier.js index 87a378b7..8370a2f4 100644 --- a/src/rollup-plugin-prettier.js +++ b/src/rollup-plugin-prettier.js @@ -119,8 +119,10 @@ export class RollupPluginPrettier { return {code: output}; } - console.warn(`[${this.name}] Sourcemap is enabled, computing diff is required`); - console.warn(`[${this.name}] This may take a moment (depends on the size of your bundle)`); + if (defaultSourcemap !== 'silent') { + console.warn(`[${this.name}] Sourcemap is enabled, computing diff is required`); + console.warn(`[${this.name}] This may take a moment (depends on the size of your bundle)`); + } const magicString = new MagicString(source); const changes = diff.diffChars(source, output);