File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ var styler = require('weex-styler')
2
2
3
3
module . exports = function ( content ) {
4
4
this . cacheable && this . cacheable ( )
5
- return 'module.exports = ' + genStyleString ( content )
5
+ return 'module.exports = ' + genStyleString ( content , this )
6
6
}
7
7
8
8
// @todo :
@@ -25,13 +25,22 @@ function convertLength (k, v) {
25
25
return v
26
26
}
27
27
28
- function genStyleString ( input ) {
28
+ function genStyleString ( input , loader ) {
29
29
var output = '{}'
30
30
styler . parse ( input , function ( err , obj ) {
31
31
if ( err ) {
32
32
return
33
33
}
34
34
if ( obj && obj . jsonStyle ) {
35
+ if ( obj . log ) {
36
+ obj . log . map ( ( log ) => {
37
+ if ( log . selectors ) {
38
+ loader . emitWarning ( `${ log . selectors } : ${ log . reason } ` )
39
+ } else {
40
+ loader . emitWarning ( `${ log . reason } ` )
41
+ }
42
+ } )
43
+ }
35
44
try {
36
45
output = JSON . stringify ( obj . jsonStyle , convertLength , 2 )
37
46
. replace ( / " ( [ - + ] ? [ 0 - 9 ] * \. ? [ 0 - 9 ] + ) C S S _ U N I T _ ( [ A - Z ] + ) " / g, '$1 * CSS_UNIT.$2' )
You can’t perform that action at this time.
0 commit comments