Skip to content

Commit 7568eb6

Browse files
committed
Merge pull request #3 from jbrantly/fix-windows-support
Fixing path normalization on Windows
2 parents a6fb9a8 + c8f49a4 commit 7568eb6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
var Promise = require('bluebird');
77
var TypeScriptWebpackHost = require('./TypeScriptWebpackHost');
88
var loaderUtils = require('loader-utils');
9+
var path = require('path');
910

1011
function typescriptLoader(text) {
1112
if (this.cacheable) {
@@ -44,12 +45,14 @@ function typescriptLoader(text) {
4445
function findResultFor(output, filename) {
4546
var text;
4647
var sourceMap;
48+
filename = path.normalize(filename);
4749
for (var i = 0; i < output.outputFiles.length; i++) {
4850
var o = output.outputFiles[i];
49-
if (o.name.replace(/\.js$/, '.ts') === filename) {
51+
var outputFileName = path.normalize(o.name);
52+
if (outputFileName.replace(/\.js$/, '.ts') === filename) {
5053
text = o.text;
5154
}
52-
if (o.name.replace(/\.js.map$/, '.ts') === filename) {
55+
if (outputFileName.replace(/\.js.map$/, '.ts') === filename) {
5356
sourceMap = o.text;
5457
}
5558
}

0 commit comments

Comments
 (0)