From 981e48b8a80ddf930bcb30cd523e28f6ad2ee2f2 Mon Sep 17 00:00:00 2001 From: amarcruz Date: Sun, 23 Oct 2016 14:55:49 -0500 Subject: [PATCH] v0.3.3 fixes sourceMap output --- CHANGELOG.md | 4 ++++ lib/jscc.es.js | 5 +---- lib/jscc.js | 5 +---- package.json | 2 +- src/preproc.js | 5 +---- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 007c6e2..8a1a52d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes for jscc +### v0.3.3 @ 2016-10-23 + +- Fixes issue with sourceMap generating incorrect output. + ### v0.3.2 @ 2016-10-22 - Fixes an issue with losing location in sourceMap after replacing memvars. diff --git a/lib/jscc.es.js b/lib/jscc.es.js index 4310082..95f2514 100644 --- a/lib/jscc.es.js +++ b/lib/jscc.es.js @@ -479,11 +479,8 @@ function preproc (code, filename, options) { }; if (changes && options.sourceMap) { - var name = filename || null; - result.map = magicStr.generateMap({ - source: name, - file: name && ((name.split(/[\\/]/).pop()) + ".map"), + source: filename || null, includeContent: options.mapContent !== false, hires: options.mapHires !== false }); diff --git a/lib/jscc.js b/lib/jscc.js index 34cee53..8a882f1 100644 --- a/lib/jscc.js +++ b/lib/jscc.js @@ -481,11 +481,8 @@ function preproc (code, filename, options) { }; if (changes && options.sourceMap) { - var name = filename || null; - result.map = magicStr.generateMap({ - source: name, - file: name && ((name.split(/[\\/]/).pop()) + ".map"), + source: filename || null, includeContent: options.mapContent !== false, hires: options.mapHires !== false }); diff --git a/package.json b/package.json index 82c9107..fbad4ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jscc", - "version": "0.3.2", + "version": "0.3.3", "description": "The JavaScript preprocessor for conditional comments and replacements in text files", "main": "./lib/jscc.js", "module": "./lib/jscc.es.js", diff --git a/src/preproc.js b/src/preproc.js index 806411c..627fc79 100644 --- a/src/preproc.js +++ b/src/preproc.js @@ -69,11 +69,8 @@ export default function preproc (code, filename, options) { } if (changes && options.sourceMap) { - const name = filename || null - result.map = magicStr.generateMap({ - source: name, - file: name && `${name.split(/[\\/]/).pop()}.map`, + source: filename || null, includeContent: options.mapContent !== false, hires: options.mapHires !== false })