@bundlekit/plugin-vue 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# @bundlekit/plugin-vue
|
|
2
|
+
|
|
3
|
+
Vue 3 构建插件,为 BundleKit 提供 Vue 3 项目模板和构建支持。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -D @bundlekit/plugin-vue
|
|
9
|
+
# 或
|
|
10
|
+
pnpm add -D @bundlekit/plugin-vue
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 使用
|
|
14
|
+
|
|
15
|
+
### 自动配置
|
|
16
|
+
|
|
17
|
+
在 `@bundlekit/cli` 创建项目时选择 Vue 模板:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bc create my-app -t vue3-ts
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 手动配置
|
|
24
|
+
|
|
25
|
+
在 `.bundlekitrc.ts` 中添加插件:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
export default defineConfig({
|
|
29
|
+
plugins: ['@bundlekit/plugin-vue'],
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 功能特性
|
|
34
|
+
|
|
35
|
+
- ✅ Vue 3.5+ 支持
|
|
36
|
+
- ✅ TypeScript / JavaScript 模板
|
|
37
|
+
- ✅ SFC(单文件组件)支持
|
|
38
|
+
- ✅ 热模块替换(HMR)
|
|
39
|
+
- ✅ SSR 支持
|
|
40
|
+
- ✅ Vue TSC 类型检查
|
|
41
|
+
|
|
42
|
+
## 模板选项
|
|
43
|
+
|
|
44
|
+
| 模板 | 说明 |
|
|
45
|
+
|------|------|
|
|
46
|
+
| `vue3-ts` | Vue 3 + TypeScript |
|
|
47
|
+
| `vue3-js` | Vue 3 + JavaScript |
|
|
48
|
+
|
|
49
|
+
## 生成的项目结构
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
my-app/
|
|
53
|
+
├── src/
|
|
54
|
+
│ ├── main.ts # 应用入口
|
|
55
|
+
│ ├── App.vue # 根组件
|
|
56
|
+
│ ├── entry-client.ts # SSR 客户端入口(可选)
|
|
57
|
+
│ └── entry-server.ts # SSR 服务端入口(可选)
|
|
58
|
+
├── public/
|
|
59
|
+
│ └── index.html # HTML 模板
|
|
60
|
+
├── mock/
|
|
61
|
+
│ └── index.ts # Mock 数据
|
|
62
|
+
└── .bundlekitrc.ts # 构建配置
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## SSR 支持
|
|
66
|
+
|
|
67
|
+
创建 SSR 项目:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
bc create my-app -t vue3-ts --ssr
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
生成的配置:
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
export default defineConfig({
|
|
77
|
+
config: {
|
|
78
|
+
production: {
|
|
79
|
+
entry: 'src/entry-client.ts',
|
|
80
|
+
ssr: {
|
|
81
|
+
entry: 'src/entry-server.ts',
|
|
82
|
+
output: { dir: 'dist/server', filename: 'server.cjs' },
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 文档
|
|
90
|
+
|
|
91
|
+
完整文档请访问 [https://bundlekit.dev](https://bundlekit.dev)
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
ISC
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bundlekit/plugin-vue",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Vue 3 plugin for bundlekit - provides Vue 3 build support and project templates",
|
|
5
5
|
"main": "./index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@vitejs/plugin-vue": "^5.2.0",
|
|
22
22
|
"vue": "^3.5.0",
|
|
23
23
|
"vue-tsc": "^2.2.0",
|
|
24
|
-
"@bundlekit/shared-utils": "0.0.
|
|
24
|
+
"@bundlekit/shared-utils": "0.0.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"typescript": "^5.8.2"
|