From 7604b74b5a9645b7b04634d22a24a65d4c20627c Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Tue, 5 Apr 2016 14:45:18 +0100 Subject: [PATCH 1/2] convert-source-map@^1.2.0 The generateMapFileComment() method used in #662 isn't available in v1.1.2. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a616c866f..7c3d8c462 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "cli-truncate": "^0.2.0", "co-with-promise": "^4.6.0", "common-path-prefix": "^1.0.0", - "convert-source-map": "^1.1.2", + "convert-source-map": "^1.2.0", "core-assert": "^0.1.0", "debug": "^2.2.0", "empower-core": "^0.5.0", From c049550b0162ae8c70a881068b08399a773eee1b Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Tue, 5 Apr 2016 14:47:11 +0100 Subject: [PATCH 2/2] use already required convert-source-map dependency No need to require the generateMapFileComment() method separately. Also remove unnecessary linebreak at the end of the file. --- lib/caching-precompiler.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/caching-precompiler.js b/lib/caching-precompiler.js index 3a578097c..bc7a07663 100644 --- a/lib/caching-precompiler.js +++ b/lib/caching-precompiler.js @@ -1,7 +1,6 @@ 'use strict'; var path = require('path'); var fs = require('fs'); -var generateMapFileComment = require('convert-source-map').generateMapFileComment; var convertSourceMap = require('convert-source-map'); var cachingTransform = require('caching-transform'); var objectAssign = require('object-assign'); @@ -84,7 +83,7 @@ CachingPrecompiler.prototype._transform = function (code, filePath, hash) { // is cached. This will allow the source map to be resolved. var dirPath = path.dirname(filePath); var relativeMapPath = path.relative(dirPath, mapPath); - var comment = generateMapFileComment(relativeMapPath); + var comment = convertSourceMap.generateMapFileComment(relativeMapPath); return result.code + '\n' + comment; }; @@ -183,4 +182,3 @@ CachingPrecompiler.prototype._generateHash = function (code, filePath, salt) { return hash; }; -