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 🙏

© 2024 – Pkg Stats / Ryan Hefner

vite-plugin-vue-code-dev-link

v1.2.1

Published

一个用于vite的代码链接工具,本人使用vite+vue3+vscode可以完成跳转

Downloads

13

Readme

视频看这

代码跳转工具(code-link)Alt+鼠标左键点击跳转

一个实现 dom 元素跳转至对应代码行的 vite 插件,运行环境为 vite+vue3+VSCode

通过 Alt+鼠标左键的方式点击 dom 元素跳转至 VSCode 对应行。

如果点击元素在代码中不存在,则会跳转至其存在代码的父元素,如 ElementPlus 中的 table 中的元素。

引入

1、引入 vite 插件和客户端点击插件;

npm install vite-plugin-vue-code-dev-link
npm install code-dev-link-client

2、vite.config.js 中使用;

//...
import { codeLinkServer, codeLinkLoader } from "vite-plugin-vue-code-dev-link";

export default defineConfig({
    plugins: [
        //...
        codeLinkServer(),
        codeLinkLoader(),
    ],
    //...
});

3、入口文件 main.js 中使用

import client from "code-dev-link-client";

if (process.env.NODE_ENV === "development") {
    client();
}

编辑器命令加入环境变量

vscode 的 code 命令

  • vscode 的定位功能是基于 vscode 的 code 命令实现的,所以请确认 code 命令是否有效(cmd 或 shell 里直接执行 code)
  • 若 code 命令找不到请如下操作: 方案 1 使用 command + shift + p (注意 window 下使用 ctrl + shift + p ) 然后搜索 code,选择 install 'code' command in path。 方案 2 也可直接手动将 code 命令的路径添加到环境变量中

注意事项

  • 插件会根据生产与开发环境决定是否启用,不会对生产环境造成任何影响
  • 仅支持 vue+vite+vscode,如果想在 webpack 用类似功能的可以参考这个,如果想在 react 里使用类似功能可以用LocatorJS,本插件是因为环境和二者都不符故才自己动手。当然也抄了二者非常多东西,嘿嘿。
  • 第一次发布插件,存在 bug 的话可以发邮件至[email protected]