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-lowcode-material-vue

v0.0.2

Published

Ali lowcode-engine vue material build plugin for vite.

Downloads

2

Readme

vite-plugin-lowcode-material-vue

用来构建适用于 @knxcloud/lowcode-engine-vue 项目物料的vite插件和项目结构示例项目。

示例项目如何使用?


git clone https://github.com/penjj/vite-plugin-lowcode-material-vue.git

corepack enable # 如果你没有运行过这行,需要node版本大于16

pnpm i

cd example

# 启动开发服务
pnpm dev

example/ 下关于配置方法有详细注释, 有疑问可以提ISSUE。方便的话给我点个Star, Thanks!

Install

pnpm i vite-plugin-lowcode-material-vue -D

Usage

// vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import unocss from 'unocss/vite'
import { presetUno } from 'unocss'
import buildMaterial from 'vite-plugin-lowcode-material-vue'
import { version } from './package.json'
import { resolve } from 'node:path'

export default defineConfig(() => {
  const envDir = resolve('.env')
  return {
    envDir,
    clearScreen: false,
    plugins: [
      buildMaterial({
        plugins: () => [
          vue(),
          unocss({
            presets: [presetUno()],
          }),
        ],
        // 物料路径
        // 期望有入口 index.ts,内部需要导出所有组件。本插件会基于此配置构建 bundle.js
        // 每个文件夹下需导出一个meta.ts,里面为组件物料描述配置
        /**
         * src/
         *   background/
         *     Background.vue
         *     meta.ts
         *   componentB/
         *     xxx.vue
         *     meta.ts
         *  index.ts
         */
        materialFolder: resolve('src'),
        // 构建后拼接的路径前缀
        baseUrl: '/dist',
        // 组件版本
        version,
        // iife 全局名称,即挂载到window上的名字
        packageName: 'Demo',
        // 构建输出路径
        outDir: 'dist',
        // 运行 pnpm dev 后,请访问您的 http://localhost:8088 端口
        assetsPort: 8088,
        envDir: resolve('.env'),
        overrides: {},
      }),
    ],
  }
})
// tsconfig.json
{
  // ...
  "compilerOptions": {
    // ...
    "types": ["vite/client", "vite-plugin-lowcode-material-vue/global"] // 内部定义了两个构建时的环境变量类型
  }
}