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-css-generator

v2.5.8

Published

css file generator only write class name

Downloads

38

Readme

css-generator-plugin 自动生成css文件,高效开发页面

在线尝试

更新记录

如何使用

  • 安装依赖

    webpack 小程序用户

    npm i css-generator-plugin -D
      or
    yarn add css-generator-plugin -D

    webpack配置

    const CssGeneratorPlugin = require('css-generator-plugin')
    {
      // ... other config settings 
      plugins: [
        new CssGeneratorPlugin()
      ]
    };

    在项目入口文件中引入 生成的css

    import '@/style/auto.css'

    vite 用户

    npm i vite-plugin-css-generator -D
      or
    yarn add vite-plugin-css-generator -D

    vite 配置

    import CssGenerator from 'vite-plugin-css-generator'
    export default defineConfig({
      // ... other config settings 
      plugins:[
        CssGenerator()
      ]
    })

    在项目入口文件中引入 生成的css

    import '@/style/auto.css'

    生成器 用户

    npm i css-generator-script
      or
    yarn add css-generator-script

    项目入口中引用

    // Gcss(<配置项>) 写入配置项
    import Gcss from 'css-generator-script'
    new Gcss({}).start()

    CDN 引入

    <html>
    <head>
      <script src="https://cdn.jsdelivr.net/npm/css-generator-script/gcss.js"></script>
    </head>
    <body>
    </body>
    <script>
      // {} is config
      new window.Gcss({}).start()
    </script>
    </html>

生成代码提示文件

将会在根目录生成 auto-use-snippets.css 作为代码提示文件

npx gen-snippets
 or
yarn gen-snippets

配置项

webpack 或 vite 用户请 下载本项目中配置文件 .css.generator.js 到项目根目录

cdn 或生成器用户 请在 函数中传入配置


### 命令行启动(如小程序类和老项目,无webpack)
+ 运行指令
```text
npx css-generator
  or
yarn css-generator

规则说明与进阶使用