@@ -39,15 +39,8 @@ function apply(patterns, opts, compiler) {
3939
4040 // Determine if this is an absolute to
4141 var absDest ;
42- if ( os . platform ( ) === 'win32' ) {
43- var winRootMatcher = / ^ [ A - z ] : \\ \\ / ;
44- if ( winRootMatcher . test ( relDest ) ) {
45- absDest = relDest ;
46- }
47- } else {
48- if ( relDest [ 0 ] === '/' ) {
49- absDest = relDest ;
50- }
42+ if ( path . isAbsolute ( relDest ) ) {
43+ absDest = relDest ;
5144 }
5245
5346 var forceWrite = ! ! pattern . force ;
@@ -76,7 +69,7 @@ function apply(patterns, opts, compiler) {
7669
7770 return globAsync ( relSrc , { cwd : baseDir } )
7871 . each ( function ( relFileSrc ) {
79-
72+
8073 // Skip if it matches any of our ignore list
8174 if ( shouldIgnore ( relFileSrc , ignoreList ) ) {
8275 return ;
@@ -98,8 +91,12 @@ function apply(patterns, opts, compiler) {
9891 }
9992
10093 if ( ! stat && relFileDirname !== baseDir ) {
101- // If the file is in a subdirectory (from globbing), we should correctly map the dest folder
102- relFileDest = path . join ( path . relative ( baseDir , relFileDirname ) , path . basename ( relFileSrc ) ) ;
94+ if ( path . isAbsolute ( relFileSrc ) ) {
95+ // If the file is in a subdirectory (from globbing), we should correctly map the dest folder
96+ relFileDest = path . join ( path . relative ( baseDir , relFileDirname ) , path . basename ( relFileSrc ) ) ;
97+ } else {
98+ relFileDest = relFileSrc ;
99+ }
103100 } else if ( toLooksLikeDirectory ( pattern ) ) {
104101 relFileDest = path . join ( relFileDest , path . basename ( relFileSrc ) ) ;
105102 } else {
0 commit comments