Skip to content

Commit

Permalink
Update release
Browse files Browse the repository at this point in the history
  • Loading branch information
ivogabe committed Oct 27, 2016
1 parent 6e0aa14 commit 4f4c140
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion release/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
6 changes: 3 additions & 3 deletions release/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions release/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as reporter from './reporter';
export interface Map<T> {
[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.
Expand Down
4 changes: 4 additions & 0 deletions release/utils.js
Original file line number Diff line number Diff line change
@@ -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();
}
Expand Down

0 comments on commit 4f4c140

Please sign in to comment.