From c08b4d3f7f31f47938373ce2aaf1a0a7b3679264 Mon Sep 17 00:00:00 2001 From: Sivasubramanyam A Date: Mon, 15 Jul 2019 22:08:44 +0530 Subject: [PATCH] Toggle code highlighting for broccoli-middleware >= 2.1.0 --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 1c6ec9a0..78bbe5c1 100644 --- a/index.js +++ b/index.js @@ -314,7 +314,7 @@ module.exports = { options.getModuleId = require('./lib/relative-module-paths').getRelativeModulePath; } - options.highlightCode = false; + options.highlightCode = this._shouldHighlightCode(); options.babelrc = false; return options; @@ -564,6 +564,11 @@ module.exports = { return checker.gte('0.6.0'); }, + _shouldHighlightCode() { + let checker = new VersionChecker(this.parent).for('broccoli-middleware', 'npm'); + return checker.gte('2.1.0'); + }, + // detect if running babel would do nothing... and do nothing instead _shouldDoNothing(options) { return !options.sourceMaps && !options.plugins.length;