File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -9,20 +9,25 @@ var options = {
99 modules : [ {
1010 postTransformNode ( el ) {
1111 if ( el . tag === 'img' ) {
12- el . staticAttrs && el . staticAttrs . some ( rewrite )
12+ el . attrs && el . attrs . some ( rewrite )
1313 }
1414 }
1515 } ]
1616}
1717
1818function rewrite ( attr ) {
1919 if ( attr . name === 'src' ) {
20- var firstChar = attr . value . charAt ( 1 )
20+ var value = attr . value
21+ var isStatic = value . charAt ( 0 ) === '"' && value . charAt ( value . length - 1 ) === '"'
22+ if ( ! isStatic ) {
23+ return
24+ }
25+ var firstChar = value . charAt ( 1 )
2126 if ( firstChar === '.' || firstChar === '~' ) {
2227 if ( firstChar === '~' ) {
23- attr . value = '"' + attr . value . slice ( 2 )
28+ value = '"' + value . slice ( 2 )
2429 }
25- attr . value = `require(${ attr . value } )`
30+ attr . value = `require(${ value } )`
2631 }
2732 return true
2833 }
Original file line number Diff line number Diff line change 4040 "source-map" : " ^0.5.6" ,
4141 "vue-hot-reload-api" : " ^2.0.1" ,
4242 "vue-style-loader" : " ^1.0.0" ,
43- "vue-template-compiler" : " ^2.0.0-alpha.8 "
43+ "vue-template-compiler" : " ^2.0.0-beta.6 "
4444 },
4545 "peerDependencies" : {
4646 "css-loader" : " ^0.23.1"
You can’t perform that action at this time.
0 commit comments