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

@sdata/web-vue-auto-import-resolver

v3.21.3

Published

Auto import resolver for @sdata/web-vue and unplugin-vue-components.

Downloads

659

Readme

@sdata/web-vue-auto-import-resolver

@sdata/web-vue-auto-import-resolver@sdata/web-vue 提供 unplugin-vue-components 自动导入解析能力,以及 SCSS 别名解析。

解析器会在运行时读取已安装的 @sdata/web-vue 发布产物来识别组件导出,因此新增组件后不需要再维护额外的组件映射文件。

当前解析器仅面向模板自动导入场景,不支持 SSR。

安装

pnpm add @sdata/web-vue
pnpm add -D @sdata/web-vue-auto-import-resolver unplugin-vue-components

Vite(推荐)

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import Components from 'unplugin-vue-components/vite';
import { SdDesignResolver, createSdDesignVitePlugin } from '@sdata/web-vue-auto-import-resolver';

export default defineConfig({
  plugins: [
    vue(),
    createSdDesignVitePlugin(),
    Components({
      resolvers: [SdDesignResolver()],
    }),
  ],
});

createSdDesignVitePlugin() 会自动配置 Sass importer 来解析 @sdata/web-vue SCSS 文件中的 @style/@components/ 别名。

手动配置 SCSS importer

createSdDesignVitePlugin() 实际上就是在 config hook 里调用了 createSdDesignScssImporter() 并注入到 css.preprocessorOptions.scss.importers。如果你不想用 Vite 插件,或者需要在非 Vite 环境下使用,可以手动配置:

import { defineConfig } from 'vite';
import { createSdDesignScssImporter } from '@sdata/web-vue-auto-import-resolver';

export default defineConfig({
  css: {
    preprocessorOptions: {
      scss: {
        importers: [createSdDesignScssImporter()],
      },
    },
  },
});

选项

SdDesignResolver

interface SdDesignResolverOptions {
  /** @default 'Sd' */
  prefix?: string;
}
  • prefix:组件前缀,默认是 Sd,对应模板里的 <sd-button />

createSdDesignScssImporter / createSdDesignVitePlugin

interface SdDesignScssImporterOptions {
  /** @default '@sdata/web-vue' */
  packageName?: string;
}
  • packageName@sdata/web-vue 的包名,默认不需要修改。