Merge pull request #12653 from atom/dg-fix-sourcemaps-windows

Fix source maps for typescript and babel on Windows
This commit is contained in:
Damien Guard
2016-09-09 16:11:15 -07:00
committed by GitHub
3 changed files with 8 additions and 4 deletions

View File

@@ -49,6 +49,10 @@ exports.compile = function (sourceCode, filePath) {
Logger.prototype.verbose = noop
}
if (process.platform === 'win32') {
filePath = 'file:///' + path.resolve(filePath).replace(/\\/g, '/')
}
var options = {filename: filePath}
for (var key in defaultOptions) {
options[key] = defaultOptions[key]

View File

@@ -64,10 +64,6 @@ function start () {
app.removeListener('open-url', addUrlToOpen)
const AtomApplication = require(path.join(args.resourcePath, 'src', 'main-process', 'atom-application'))
AtomApplication.open(args)
if (!args.test) {
console.log(`App load time: ${Date.now() - global.shellStartTime}ms`)
}
})
}

View File

@@ -37,6 +37,10 @@ exports.compile = function (sourceCode, filePath) {
TypeScriptSimple = require('typescript-simple').TypeScriptSimple
}
if (process.platform === 'win32') {
filePath = 'file:///' + path.resolve(filePath).replace(/\\/g, '/')
}
var options = _.defaults({filename: filePath}, defaultOptions)
return new TypeScriptSimple(options, false).compile(sourceCode, filePath)
}