提交 6e546fb1 编写于 作者: fxy060608's avatar fxy060608

fix(v3): normalize windows path

上级 7d0fd18e
const isWin = /^win/.test(process.platform)
const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)
const METHODS = ['error', 'warn', 'info', 'log', 'debug']
const FORMAT_LOG = '__f__'
module.exports = function({
......@@ -33,7 +36,7 @@ module.exports = function({
}
args.push({
type: 'StringLiteral',
value: ` at ${file}:${path.node.loc.start.line}`
value: ` at ${normalizePath(file)}:${path.node.loc.start.line}`
})
args.unshift(t.stringLiteral(path.node.callee.property.name))
path.replaceWith(t.callExpression(t.identifier(FORMAT_LOG), args))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册