npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

vite-plugin-vue-code-position

v0.1.10

Published

<br><br> #### 安装 ```js npm i vite-plugin-vue-code-position -D ```

Readme

代码定位插件 Vue 3 + TypeScript + Vite

按住Alt+鼠标左键 单击 页面中的元素,可以跳转到对应的代码页面

安装

npm i vite-plugin-vue-code-position -D

使用

  1. 在vite.config.ts中引入插件,然后启动项目就可以了,按住alt+鼠标左键单击页面中的元素就可以跳转到对应的代码位置
import CodePosition from 'vite-plugin-vue-code-position'

export default defineConfig({
  plugins: [CodePosition(), vue()],
})

1.1 如果是vite版本低于5的,不能直接通过import引入插件 需要写一个方法引入

async function codePosition(data) {
    const plugin = await import('vite-plugin-vue-code-position');
    return plugin.default(data);
}

export default defineConfig({
  plugins: [CodePosition({PORT:3213}), vue()],

})

  1. 可以指定端口和打开的编辑器,如果不配置,则默认是localhost:3213 ,默认打开的是code
import CodePosition from 'vite-plugin-vue-code-position'

export default defineConfig({
  plugins: [CodePosition({IDE:'code'}), vue()],
})

//也可以使用trae打开 CodePosition({IDE:'trae'}

注意! 关于IDE 短名的配置
这里的{IDE:'code'} 表示打开的是vscode
其中的code 实际上是vscode安装目录下的 bin目录下的文件名称,就叫code 没有后缀
之所以能找到code 是因为在环境变量中添加了vscode的安装目录
比如我常用trae开发,我的trae编辑器的安装目录 D:\software\Trae
那我的环境变量 就是在用户变量的path中添加 D:\software\Trae\bin   
bin文件夹下 就有一个名叫trae的文件

//我一开始是配置在系统变量的,但是发现不行,只有在用户变量的path中添加了才可以

  1. 可以更换端口
//如果控制台报错 说端口占用 请及时更换端口
import CodePosition from 'vite-plugin-vue-code-position'

export default defineConfig({
  plugins: [CodePosition({IDE:'code',port:3210}), vue()],
})