feat(compiler): include names in source map

This commit is contained in:
Evan You
2019-09-26 10:13:46 -04:00
parent 9be19bcd7e
commit 3bba461128
4 changed files with 105 additions and 26 deletions

View File

@@ -1,7 +1,12 @@
import { NodeTransform } from '../transform'
import { NodeTypes, createExpression } from '../ast'
// prase inline CSS strings for static style attributes into an object
// Parse inline CSS strings for static style attributes into an object.
// This is a NodeTransform since it works on the static `style` attribute and
// converts it into a dynamic equivalent:
// style="color: red" -> :style='{ "color": "red" }'
// It is then processed by `transformElement` and included in the generated
// props.
export const transformStyle: NodeTransform = (node, context) => {
if (node.type === NodeTypes.ELEMENT) {
node.props.forEach((p, i) => {