We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 65079e9 commit 87decf4Copy full SHA for 87decf4
1 file changed
lib/Compiler.js
@@ -2,6 +2,7 @@
2
MIT License http://www.opensource.org/licenses/mit-license.php
3
Author Tobias Koppers @sokra
4
*/
5
+var path = require("path");
6
var clone = require("clone");
7
var Tapable = require("tapable");
8
@@ -235,9 +236,9 @@ Compiler.prototype.emitAssets = function(compilation, callback) {
235
236
if(queryStringIdx >= 0) {
237
targetFile = targetFile.substr(0, queryStringIdx);
238
}
- if(targetFile.indexOf("/") >= 0) {
239
- var idx = targetFile.lastIndexOf("/");
240
- var dir = targetFile.substr(0, idx);
+
+ if(targetFile.match(/\/|\\/)) {
241
+ var dir = path.dirname(targetFile);
242
this.outputFileSystem.mkdirp(this.outputFileSystem.join(outputPath, dir), writeOut.bind(this));
243
} else writeOut.call(this);
244
function writeOut(err) {
0 commit comments