Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用 ElMessage 会导致 sourcemap 的位置不对 #177

Open
xuxchao opened this issue Jan 17, 2023 · 0 comments
Open

使用 ElMessage 会导致 sourcemap 的位置不对 #177

xuxchao opened this issue Jan 17, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@xuxchao
Copy link

xuxchao commented Jan 17, 2023

复现步骤:

  1. 创建一个 vite 初始化的 vue 项目。配置和 App.vue 代码如下。
  2. 启动项目,单击进入会发现 console.log 打印的代码位置是有问题的。

image

期望能够识别到正确的位置
App.vue

<template>
  <div @click="tapSdk">进入</div>
</template>
<script setup lang="ts">
import { ElMessage } from "element-plus";

const tapSdk = async () => {
  console.log("xxx");
  ElMessage.error("xxx");
};
</script>

vite.config.ts

import { fileURLToPath, URL } from "node:url";

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";

import ElementPlus from "unplugin-element-plus/vite";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), vueJsx(), ElementPlus()],
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
    },
  },
});
@sxzz sxzz added the bug Something isn't working label Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants