From 4f4c140592d865ebba140ffd29d675e1270fad5c Mon Sep 17 00:00:00 2001 From: Ivo Gabe de Wolff Date: Thu, 27 Oct 2016 22:06:39 +0200 Subject: [PATCH] Update release --- release/main.js | 4 +++- release/output.js | 6 +++--- release/utils.d.ts | 1 + release/utils.js | 4 ++++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/release/main.js b/release/main.js index 2f48ce95..b6e235d7 100644 --- a/release/main.js +++ b/release/main.js @@ -58,7 +58,9 @@ function getCompilerOptions(settings, projectPath, configFileName) { option === 'sortOutput' || option === 'typescript' || option === 'sourceMap' || - option === 'inlineSourceMap') + option === 'inlineSourceMap' || + option === 'sourceRoot' || + option === 'inlineSources') continue; newSettings[option] = settings[option]; } diff --git a/release/output.js b/release/output.js index 679c5b3c..1331f5a6 100644 --- a/release/output.js +++ b/release/output.js @@ -41,7 +41,7 @@ var Output = (function () { var directory = path.dirname(output.path); // gulp-sourcemaps docs: // paths in the generated source map (`file` and `sources`) are relative to `file.base` (e.g. use `file.relative`). - map.file = output.relative; + map.file = utils.forwardSlashes(output.relative); map.sources = map.sources.map(relativeToOutput); delete map.sourceRoot; var generator = sourceMap.SourceMapGenerator.fromSourceMap(new sourceMap.SourceMapConsumer(map)); @@ -70,8 +70,8 @@ var Output = (function () { } return generator.toString(); function relativeToOutput(fileName) { - var absolute = path.resolve(directory, fileName.replace(/\\/g, '/')); - return path.relative(output.base, absolute); + var absolute = path.resolve(directory, fileName); + return utils.forwardSlashes(path.relative(output.base, absolute)); } }; Output.prototype.finish = function (result) { diff --git a/release/utils.d.ts b/release/utils.d.ts index 7f40e33f..de309db5 100644 --- a/release/utils.d.ts +++ b/release/utils.d.ts @@ -4,6 +4,7 @@ import * as reporter from './reporter'; export interface Map { [key: string]: T; } +export declare function forwardSlashes(fileName: string): string; export declare function normalizePath(pathString: string): string; /** * Splits a filename into an extensionless filename and an extension. diff --git a/release/utils.js b/release/utils.js index fbd442b4..8185ab43 100644 --- a/release/utils.js +++ b/release/utils.js @@ -1,6 +1,10 @@ "use strict"; var path = require('path'); var gutil = require('gulp-util'); +function forwardSlashes(fileName) { + return fileName.replace(/\\/g, '/'); +} +exports.forwardSlashes = forwardSlashes; function normalizePath(pathString) { return path.normalize(pathString).toLowerCase(); }