File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -39,28 +39,29 @@ function cssExtract(bundle, opts) {
39
39
40
40
function extract ( chunk ) {
41
41
42
- if ( chunk . source . indexOf ( 'vueify-insert-css ' ) === - 1 ) return ''
42
+ if ( chunk . source . indexOf ( '__vueify_insert__ ' ) === - 1 ) return ''
43
43
44
44
const css = [ ]
45
45
46
46
const ast = falafel ( chunk . source , {
47
47
ecmaVersion : 6
48
48
} , function ( node ) {
49
- if ( ! isRequire ( node ) ) return
50
49
51
- if ( ! node . arguments ) return
52
-
53
- if ( ! node . arguments [ 0 ] ) return
50
+ if ( node . type !== 'CallExpression' ) return
54
51
55
- if ( node . arguments [ 0 ] . value !== 'vueify-insert-css' ) return
52
+ if ( ! node . callee . object ) return
56
53
57
- if ( ! node . parent . parent . arguments || ! node . parent . parent . arguments [ 0 ] ) return
54
+ if ( ! node . callee . object . name || node . callee . object . name !== '__vueify_insert__' ) return
55
+
56
+ if ( ! node . arguments ) return
58
57
59
- css . push ( node . parent . parent . arguments [ 0 ] . value )
60
- node . parent . parent . update ( '0' )
58
+ if ( ! node . arguments [ 0 ] ) return
59
+
60
+ css . push ( node . arguments [ 0 ] . value )
61
+ node . update ( '0' )
61
62
} ) ;
62
63
63
64
chunk . source = ast . toString ( )
64
65
65
66
return css . join ( '\n' )
66
- }
67
+ }
You can’t perform that action at this time.
0 commit comments