Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uni-helper/vite-plugin-uni-platform-modifier
为属性、指令提供平台修饰符并按需编译
https://github.com/uni-helper/vite-plugin-uni-platform-modifier
Last synced: about 1 month ago
JSON representation
为属性、指令提供平台修饰符并按需编译
- Host: GitHub
- URL: https://github.com/uni-helper/vite-plugin-uni-platform-modifier
- Owner: uni-helper
- License: mit
- Created: 2023-10-30T09:08:44.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-01T14:56:37.000Z (about 1 year ago)
- Last Synced: 2024-11-20T14:48:40.274Z (about 2 months ago)
- Language: TypeScript
- Size: 271 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-uni-app - vite - helper/vite-plugin-uni-platform-modifier) - 为属性、指令提供平台修饰符并按需编译。 (打包器插件)
README
# vite-plugin-uni-platform-modifier
为属性、指令提供平台修饰符并按需编译
## 安装
```bash
pnpm i -D @uni-helper/vite-plugin-uni-platform-modifier
```## 使用
### 配置
```ts
// vite.config.ts
import { defineConfig } from 'vite'
import Uni from '@dcloudio/vite-plugin-uni'
import UniPlatformModifier from '@uni-helper/vite-plugin-uni-platform-modifier'export default defineConfig({
plugins: [Uni(), UniPlatformModifier()],
})
```### 编写代码
```html
```
编译到H5
```html
```
编译到微信小程序
```html
```
编译到其他平台
```html
```
### 支持的修饰符
```js
['app', 'app-plus', 'h5', 'mp-360', 'mp-alipay', 'mp-baidu', 'mp-jd', 'mp-kuaishou', 'mp-lark', 'mp-qq', 'mp-toutiao', 'mp-weixin', 'quickapp-webview', 'quickapp-webview-huawei', 'quickapp-webview-union']
```