Skip to content

Commit

Permalink
Merge pull request #29 from mpvue/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
anchengjian authored Jun 15, 2018
2 parents dcb95dd + 8458ae4 commit 439de28
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
9 changes: 5 additions & 4 deletions lib/style-compiler/plugins/scope-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ module.exports = postcss.plugin('add-id', function (opts) {
if (/-?animation$/.test(decl.prop)) {
decl.value = decl.value.split(',')
.map(v => {
var vals = v.split(/\s+/)
var name = vals[0]
if (keyframes[name]) {
return [keyframes[name]].concat(vals.slice(1)).join(' ')
var vals = v.trim().split(/\s+/)
var i = vals.findIndex(val => keyframes[val])
if (i !== -1) {
vals.splice(i, 1, keyframes[vals[i]])
return vals.join(' ')
} else {
return v
}
Expand Down
5 changes: 4 additions & 1 deletion lib/template-compiler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module.exports = function (html) {
: compiler.compile

var compiled = compile(html, compilerOptions)
var code

// for mp => *.wxml
compileWxml.call(this, compiled, html)
Expand All @@ -51,7 +52,6 @@ module.exports = function (html) {
})
}

var code
if (compiled.errors && compiled.errors.length) {
this.emitError(
`\n Error compiling template:\n${pad(html)}\n` +
Expand Down Expand Up @@ -94,6 +94,9 @@ module.exports = function (html) {

this.callback(null, code)
})
.catch(() => {
this.callback(null, code)
})
}

function toFunction (code) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mpvue-loader",
"version": "1.0.14",
"version": "1.0.15",
"description": "mpvue single-file component loader for Webpack",
"main": "index.js",
"repository": {
Expand Down

0 comments on commit 439de28

Please sign in to comment.