@@ -235,29 +235,26 @@ function loadImportContent(result, stmt, filename, options, state) {
235235 // skip previous imported files not containing @import rules
236236 if ( state . hashFiles [ content ] && state . hashFiles [ content ] [ media ] ) return
237237
238- return processContent (
239- result ,
240- content ,
241- filename ,
242- options
243- ) . then ( importedResult => {
244- const styles = importedResult . root
245- result . messages = result . messages . concat ( importedResult . messages )
246-
247- if ( options . skipDuplicates ) {
248- const hasImport = styles . some ( child => {
249- return child . type === "atrule" && child . name === "import"
250- } )
251- if ( ! hasImport ) {
252- // save hash files to skip them next time
253- if ( ! state . hashFiles [ content ] ) state . hashFiles [ content ] = { }
254- state . hashFiles [ content ] [ media ] = true
238+ return processContent ( result , content , filename , options ) . then (
239+ importedResult => {
240+ const styles = importedResult . root
241+ result . messages = result . messages . concat ( importedResult . messages )
242+
243+ if ( options . skipDuplicates ) {
244+ const hasImport = styles . some ( child => {
245+ return child . type === "atrule" && child . name === "import"
246+ } )
247+ if ( ! hasImport ) {
248+ // save hash files to skip them next time
249+ if ( ! state . hashFiles [ content ] ) state . hashFiles [ content ] = { }
250+ state . hashFiles [ content ] [ media ] = true
251+ }
255252 }
256- }
257253
258- // recursion: import @import from imported file
259- return parseStyles ( result , styles , options , state , media )
260- } )
254+ // recursion: import @import from imported file
255+ return parseStyles ( result , styles , options , state , media )
256+ }
257+ )
261258 } )
262259}
263260
0 commit comments