@@ -107,16 +107,16 @@ function transform (filename, options) {
107107 if ( node . type !== 'CallExpression' ) return
108108 if ( ! node . callee || node . callee . type !== 'Identifier' ) return
109109 if ( node . callee . name !== mname ) return
110+ var pathOpts = { basedir : path . dirname ( filename ) }
110111 try {
111- var resolvePath = cssResolve ( node . arguments [ 0 ] . value , {
112- basedir : path . dirname ( filename )
113- } )
114- self . emit ( 'file' , resolvePath )
112+ var resolvePath = cssResolve ( node . arguments [ 0 ] . value , pathOpts )
115113 } catch ( err ) {
116114 return self . emit ( 'error' , err )
117115 }
118116
119- const iOpts = ( node . arguments [ 1 ] )
117+ self . emit ( 'file' , resolvePath )
118+
119+ const iOpts = node . arguments [ 1 ]
120120 ? xtend ( opts , staticEval ( node . arguments [ 1 ] ) )
121121 : opts
122122
@@ -149,7 +149,9 @@ function transform (filename, options) {
149149 ' || true) && ' + JSON . stringify ( prefix ) + ')'
150150 ] . join ( '' )
151151
152- const lolSemicolon = ( val . node . parent . type === 'VariableDeclarator' )
152+ const parentNodeType = val . node . parent . type
153+ const lolSemicolon = parentNodeType === 'VariableDeclarator' ||
154+ parentNodeType === 'AssignmentExpression'
153155 ? ''
154156 : ';'
155157 val . node . update ( lolSemicolon + str )
0 commit comments