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

@showlotus/code-inspector-plugin

v0.0.1

Published

A webpack plugin to quickly locate code source files.

Downloads

5

Readme

Code Inspector Plugin

[!TIP] 适用于用 Webpack 打包的 Vue 项目,借助于 Vue render 函数的 attrs 属性(在上游阶段添加 __file 属性),如果当前渲染的 DOM 节点拥有一个 __file 属性,即当前组件文件的相对路径。当触发选择器后并点击,就会打开当前 DOM 节点所在的组件源文件。注意:该插件不会向 Vue 组件中注入 __file 属性,需要在上游阶段提供。

同时按下:Alt + Shift 时,触发选择器。点击后,在编辑器中打开当前元素对应的代码源文件。

demo

安装

安装插件

npm install @showlotus/code-inspector-plugin -D

配置 Webpack

const CodeInspectorPlugin = require('@showlotus/code-inspector-plugin')

module.exports = {
  plugins: [
    new CodeInspectorPlugin({
      test: /\.ts$/,
      include: /src\//,
      exclude: /node_modules/,
      editor: 'code',
    }),
  ],
}

配置

参数

test

Type: string | RegExp | [string, RegExp]

Default: null

所有匹配的模块。

include

Type: string | RegExp | [string, RegExp]

Default: null

包含匹配到的所有模块。

exclude

Type: string | RegExp | [string, RegExp]

Default: null

排除匹配到的所有模块。

editor

Type: string

Default: code,可选值:codeideawebstorm

打开文件所用的编辑器命令。