File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 22 MIT License http://www.opensource.org/licenses/mit-license.php
33 Author Tobias Koppers @sokra
44*/
5+ var path = require ( "path" ) ;
56var clone = require ( "clone" ) ;
67var Tapable = require ( "tapable" ) ;
78
@@ -235,9 +236,9 @@ Compiler.prototype.emitAssets = function(compilation, callback) {
235236 if ( queryStringIdx >= 0 ) {
236237 targetFile = targetFile . substr ( 0 , queryStringIdx ) ;
237238 }
238- if ( targetFile . indexOf ( "/" ) >= 0 ) {
239- var idx = targetFile . lastIndexOf ( "/" ) ;
240- var dir = targetFile . substr ( 0 , idx ) ;
239+
240+ if ( targetFile . match ( / \/ | \\ / ) ) {
241+ var dir = path . dirname ( targetFile ) ;
241242 this . outputFileSystem . mkdirp ( this . outputFileSystem . join ( outputPath , dir ) , writeOut . bind ( this ) ) ;
242243 } else writeOut . call ( this ) ;
243244 function writeOut ( err ) {
You can’t perform that action at this time.
0 commit comments