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

fix: console

上级 3e11d7ba
......@@ -36,7 +36,7 @@ const plugins = [
uniConsolePlugin({
filename(filename) {
filename = path.relative(process.env.UNI_INPUT_DIR, filename)
if (filename.startsWith('.')) {
if (filename.startsWith('.') || path.isAbsolute(filename)) {
return ''
}
return filename
......
import { MagicString } from '@vue/compiler-sfc'
import { normalizePath } from '../utils'
const F = '__f__'
export function rewriteConsoleExpr(filename: string, code: string) {
filename = normalizePath(filename)
const re = /(console\.(log|info|debug|warn|error))\(([^)]+)\)/g
const locate = getLocator(code)
const s = new MagicString(code)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册