diff --git a/lib/plugin.js b/lib/plugin.js index 95790e4..eb7feba 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -110,6 +110,12 @@ ManifestPlugin.prototype.apply = function(compiler) { }.bind(this)); } + files = files.map(file => { + file.name = file.name.replace(/\\/g, '/'); + file.path = file.path.replace(/\\/g, '/'); + return file; + }); + if (this.opts.filter) { files = files.filter(this.opts.filter); } diff --git a/spec/plugin.spec.js b/spec/plugin.spec.js index 60a82ca..a319717 100644 --- a/spec/plugin.spec.js +++ b/spec/plugin.spec.js @@ -398,6 +398,24 @@ describe('ManifestPlugin', function() { done(); }); }); + + it('should output unix paths', function(done) { + webpackCompile({ + context: __dirname, + entry: { + 'dir\\main': './fixtures/file.js', + 'some\\dir\\main': './fixtures/file.js' + } + }, {}, function(manifest) { + expect(manifest).toBeDefined(); + expect(manifest).toEqual({ + 'dir/main.js': 'dir/main.js', + 'some/dir/main.js': 'some/dir/main.js' + }); + + done(); + }); + }); }); describe('with ExtractTextPlugin', function() {