File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,14 +88,15 @@ export default (options = {}) => {
8888
8989 async onwrite ( opts ) {
9090 if ( extracted . size === 0 ) return
91+ const dirnameMain = path . dirname ( opts . file )
9192
9293 const getExtracted = filepath => {
9394 if ( ! filepath ) {
9495 if ( typeof postcssLoaderOptions . extract === 'string' ) {
9596 filepath = postcssLoaderOptions . extract
9697 } else {
9798 const basename = path . basename ( opts . file , path . extname ( opts . file ) )
98- filepath = path . join ( path . dirname ( opts . file ) , basename + '.css' )
99+ filepath = path . join ( dirnameMain , basename + '.css' )
99100 }
100101 }
101102 filepath = humanlizePath ( filepath )
@@ -106,7 +107,7 @@ export default (options = {}) => {
106107 if ( map ) {
107108 map . file = filepath
108109 map . sources = map . sources . map ( source =>
109- humanlizePath ( path . join ( path . dirname ( opts . file ) , source ) )
110+ source . substr ( 0 , dirnameMain . length ) === dirnameMain ? source : humanlizePath ( path . join ( dirnameMain , source ) )
110111 )
111112 }
112113 concat . add ( relative , res . code , map )
You can’t perform that action at this time.
0 commit comments