# plugin-template
**Repository Path**: thingjs-code-temp/plugin-template
## Basic Information
- **Project Name**: plugin-template
- **Description**: 插件单包工程
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2023-02-24
- **Last Updated**: 2023-08-02
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
> 插件(Plugin)是 ThingJS API 提供的一种更综合扩展方式,用户可以在插件中开发自定义脚本、使用组件、引用模型/图片等资源内容,对一个综合的业务功能进行封装和复用。
## 📖 开发指南
```bash
# 安装依赖包
npm i
# 启动开发服务
npm run dev
# 打包项目
npm run build
# 将插件发布到资源商城中
npm run publish
```
## 🔨 开发规范
- [ThingJS 2.0 插件开发指导手册](https://wiki.uino.com/book/thingjs-plugin)
## 🔻 目录结构
```
thing-plugin
├── dist # 打包后的插件
│ ├── index.js # 插件入口文件
│ └── index.js.map # 插件压缩文件
├── src
│ ├── index.js # 插件入口文件
│ ├── components # 插件组件文件夹
│ └── bundle.json # 插件信息
├── vite.config.js # vite配置
└── index.html # 静态页面
```
## 🔨 本地测试
```
先执行 npm run build
通过此命令获得dist文件
```
### 🔻 本地目录结构
```
├── dist
└── index.html
```
### 🔻 本地使用示例
第一种使用方法(插件直接引用地址,不设置名称)
``` javascript
```
第二种使用方法(插件设置名称)
``` javascript
```