Skip to content

Commit

Permalink
fix: make sure paths are consistent from os to os
Browse files Browse the repository at this point in the history
  • Loading branch information
mastilver committed Sep 1, 2017
1 parent de15a87 commit c578e38
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ ManifestPlugin.prototype.apply = function(compiler) {
}.bind(this));
}

files = files.map(file => {
file.name = file.name.replace('\\', '/');
file.path = file.path.replace('\\', '/');
return file;
});

if (this.opts.filter) {
files = files.filter(this.opts.filter);
}
Expand Down
16 changes: 16 additions & 0 deletions spec/plugin.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,22 @@ describe('ManifestPlugin', function() {
done();
});
});

it('should output unix paths', function(done) {
webpackCompile({
context: __dirname,
entry: {
'dir\\main': './fixtures/file.js'
}
}, {}, function(manifest) {
expect(manifest).toBeDefined();
expect(manifest).toEqual({
'dir/main.js': 'dir/main.js'
});

done();
});
});
});

describe('with ExtractTextPlugin', function() {
Expand Down

0 comments on commit c578e38

Please sign in to comment.