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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@uni_toolkit/vite-plugin-sourcemap

v0.5.0

Published

一个用于 uni-app Vue3 小程序项目的 sourcemap 开关插件,可按 `NODE_ENV` 或在所有环境下开启 `build.sourcemap`。

Readme

@uni_toolkit/vite-plugin-sourcemap

一个用于 uni-app Vue3 小程序项目的 sourcemap 开关插件,可按 NODE_ENV 或在所有环境下开启 build.sourcemap。

特性

  • 只在 小程序 平台生效
  • 默认在开发环境开启 sourcemap,生产环境关闭 sourcemap
  • 支持通过 mode: 'all' 在所有环境开启 sourcemap
  • 支持 uni-app 和 uni-app-x

安装

npm install @uni_toolkit/vite-plugin-sourcemap -D
# 或
pnpm add @uni_toolkit/vite-plugin-sourcemap -D
# 或
yarn add @uni_toolkit/vite-plugin-sourcemap -D

使用方法

import { defineConfig } from 'vite';
import uni from "@dcloudio/vite-plugin-uni";
import sourcemap from '@uni_toolkit/vite-plugin-sourcemap';

export default defineConfig({
  plugins: [
    uni(),
    sourcemap(), // 插件需要放在 uni 插件后面,以确保正确覆盖 sourcemap 配置
  ],
});

默认在小程序平台下等价于:

export default defineConfig({
  // ...
  build: {
    sourcemap: process.env.NODE_ENV === 'development',
  },
});

配置项

interface VitePluginSourcemapOptions {
  mode?: 'development' | 'production' | 'all';
}
  • mode: 指定在哪些环境下开启 sourcemap,默认 development
    • development: 仅当 NODE_ENV=development 时开启
    • production: 仅当 NODE_ENV=production 时开启
    • all: 所有环境都开启

示例:

import { defineConfig } from 'vite';
import uni from "@dcloudio/vite-plugin-uni";
import sourcemap from '@uni_toolkit/vite-plugin-sourcemap';

export default defineConfig({
  plugins: [
    uni(),
    sourcemap({
      mode: 'production',
    }), // 插件需要放在 uni 插件后面,以确保正确覆盖 sourcemap 配置
  ],
});

在所有环境开启 sourcemap:

import { defineConfig } from 'vite';
import uni from "@dcloudio/vite-plugin-uni";
import sourcemap from '@uni_toolkit/vite-plugin-sourcemap';

export default defineConfig({
  plugins: [
    uni(),
    sourcemap({
      mode: 'all',
    }), // 插件需要放在 uni 插件后面,以确保正确覆盖 sourcemap 配置
  ],
});

许可证

MIT