0.0.7 • Published 9 months ago

@plugin-light/vite-plugin-ifdef v0.0.7

Weekly downloads
-
License
-
Repository
github
Last release
9 months ago

条件编译

实现了 uni-app 中的条件编译功能。

可参考对应的 webpack loader

如何使用

安装

pnpm add @plugin-light/vite-plugin-ifdef -D

vite.config.ts 中添加如下设置:

import { defineConfig } from 'vite';
import { ifdefVitePlugin } from '@plugin-light/vite-plugin-ifdef';


export default defineConfig({
  plugins: [
    ifdefVitePlugin({
      context: { H5: true, VUE3: true },
      type: ['css', 'js', 'html'],
    })
  ],
});

参数

同对应的 webpack loader

0.0.7

9 months ago

0.0.6

9 months ago