# unplugin-uniapp-h5

> 支持storybook中渲染uniapp标签

Latest version **1.0.18** (published 2023-10-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install unplugin-uniapp-h5
pnpm add unplugin-uniapp-h5
yarn add unplugin-uniapp-h5
bun add unplugin-uniapp-h5
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.18 |
| Published | 2023-10-15 |
| First published | 2023-07-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 20 |
| Unpacked size | 6.5 MB |
| Known vulnerabilities | 0 (+7 in 1 direct dependencies) |
| Install scripts | no |
| Author | calandnong |
| Maintainers | coder_pig |
| Keywords | storybook, uniapp, vite, vue3, typescript |

## Links

- npm: https://www.npmjs.com/package/unplugin-uniapp-h5
- npm.io page: https://npm.io/package/unplugin-uniapp-h5

## Dependencies (20)

- [vue](https://npm.io/package/vue.md) 3.2.47
- [vite](https://npm.io/package/vite.md) ^4.0.0
- [xregexp](https://npm.io/package/xregexp.md) 3.1.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^11.1.1
- [hash-sum](https://npm.io/package/hash-sum.md) ^2.0.0
- [picocolors](https://npm.io/package/picocolors.md) ^1.0.0
- [vue-router](https://npm.io/package/vue-router.md) ^4.2.4
- [@vue/shared](https://npm.io/package/@vue/shared.md) 3.2.47
- [autoprefixer](https://npm.io/package/autoprefixer.md) ^10.4.14
- [magic-string](https://npm.io/package/magic-string.md) ^0.30.5
- [@babel/parser](https://npm.io/package/@babel/parser.md) ^7.23.0
- [@types/hash-sum](https://npm.io/package/@types/hash-sum.md) ^1.0.0
- [safe-area-insets](https://npm.io/package/safe-area-insets.md) ^1.4.1
- [@vue/compiler-dom](https://npm.io/package/@vue/compiler-dom.md) ^3.3.4
- [@vue/runtime-core](https://npm.io/package/@vue/runtime-core.md) ^3.3.4
- [@dcloudio/uni-h5-vue](https://npm.io/package/@dcloudio/uni-h5-vue.md) 3.0.0-alpha-3080520230616001
- [vite-plugin-commonjs](https://npm.io/package/vite-plugin-commonjs.md) ^0.10.0
- [@amap/amap-jsapi-types](https://npm.io/package/@amap/amap-jsapi-types.md) ^0.0.13
- [@vitejs/plugin-vue-jsx](https://npm.io/package/@vitejs/plugin-vue-jsx.md) ^3.0.1
- [postcss-selector-parser](https://npm.io/package/postcss-selector-parser.md) ^6.0.13

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.18 (latest) — 2023-10-15
- 1.0.17 — 2023-10-15
- 1.0.16 — 2023-10-15
- 1.0.15 — 2023-10-15
- 1.0.14 — 2023-10-15
- 1.0.13 — 2023-10-14
- 1.0.12 — 2023-10-13
- 1.0.11 — 2023-10-12
- 1.0.10 — 2023-10-12
- 1.0.9 — 2023-10-10
- 1.0.8 — 2023-09-27
- 1.0.7 — 2023-09-27
- 1.0.6 — 2023-09-27
- 1.0.5 — 2023-09-27
- 1.0.4 — 2023-07-27
- … 4 more at https://npm.io/package/unplugin-uniapp-h5/versions

## README

# uniapp-vue3-storybook-vite-plugin
支持storybook中渲染uniapp的标签和组件（基于vue3和vite）

---
## 运行环境
- node
- pnpm/npm
- storybook
- vite
- vue3

---
## 安装
pnpm
```bash
pnpm add unplugin-uniapp-h5 -D
```
npm
```bash
npm install unplugin-uniapp-h5 -D
```

## 使用
项目示例：[点击此处跳转](https://github.com/calandnong/uniapp-vue3-storybook-vite-plugin/tree/dev/packages/playground/storybook)
在.storybook下的main.ts中使用此插件
```diff
import { StorybookConfig } from '@storybook/vue3-vite';
+ import { unPluginUniAppH5, createVueOptions } from 'unplugin-uniapp-h5';

const config: StorybookConfig = {
  stories: ["../stories/**/*.mdx", "../stories/**/*.stories.@(js|jsx|ts|tsx)"],
  addons: [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@storybook/addon-interactions",
  ],
  framework: {
    name: "@storybook/vue3-vite",
    options: {},
  },
  docs: {
    autodocs: "tag",
  },
  viteFinal(config) {
      const index = config.plugins?.findIndex((item) => {
      const _item = item as Plugin;
      if(_item.name === 'vite:vue') {
        console.log('查询到了',_item);
        return true;
      }
      return false;
    });
    if(index && index !== -1 && config.plugins) {    
      config.plugins[index] = vue({
        template: {
          compilerOptions: {
            // 支持@tap转化为@click
            ...createVueOptions(),
          }
        }
      });
    }
    return {
      ...config,
      plugins: [
        ...(config.plugins || []),
+        unPluginUniAppH5(),
      ],
    }
  }
};
export default config;

```

## 其他
暂无

---
_Source: https://npm.io/package/unplugin-uniapp-h5 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
