diff --git a/.changeset/unlucky-ants-enjoy.md b/.changeset/unlucky-ants-enjoy.md new file mode 100644 index 0000000000..58984ae3c7 --- /dev/null +++ b/.changeset/unlucky-ants-enjoy.md @@ -0,0 +1,5 @@ +--- +'@evidence-dev/evidence': patch +--- + +re-enable logging on dev mode diff --git a/packages/evidence/cli.js b/packages/evidence/cli.js index 0c56a3a541..54ea862c9e 100755 --- a/packages/evidence/cli.js +++ b/packages/evidence/cli.js @@ -173,7 +173,8 @@ const buildHelper = function (command, args) { ...process.env, // used for source query HMR EVIDENCE_DATA_URL_PREFIX: process.env.EVIDENCE_DATA_URL_PREFIX ?? 'static/data', - EVIDENCE_DATA_DIR: process.env.EVIDENCE_DATA_DIR ?? './static/data' + EVIDENCE_DATA_DIR: process.env.EVIDENCE_DATA_DIR ?? './static/data', + EVIDENCE_IS_BUILDING: 'true' } }); // Copy the outputs to the root of the project upon successful exit diff --git a/packages/evidence/scripts/build-template.js b/packages/evidence/scripts/build-template.js index c1cc3239ad..21bb2f8d9b 100644 --- a/packages/evidence/scripts/build-template.js +++ b/packages/evidence/scripts/build-template.js @@ -102,7 +102,14 @@ fsExtra.outputFileSync( customLogger: logger } - if (isDebug()) { + // Suppress errors when building in non-debug mode + if (!isDebug() && process.env.EVIDENCE_IS_BUILDING === 'true') { + config.logLevel = 'silent'; + logger.error = (msg) => log.error(msg); + logger.info = () => {}; + logger.warn = () => {}; + logger.warnOnce = () => {}; + } else { const loggerWarn = logger.warn; const loggerOnce = logger.warnOnce @@ -124,10 +131,6 @@ fsExtra.outputFileSync( loggerWarn(msg, options); }; - } else { - config.logLevel = 'silent'; - logger.error = (msg) => log.error(msg); - logger.info = logger.warn = logger.warnOnce = () => {}; } export default config`