@meng-xi/vite-plugin 0.0.3 → 0.0.4
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-en.md +164 -150
- package/README.md +143 -84
- package/dist/common/index.cjs +1 -1
- package/dist/common/index.d.cts +132 -6
- package/dist/common/index.d.mts +132 -6
- package/dist/common/index.d.ts +132 -6
- package/dist/common/index.mjs +1 -1
- package/dist/factory/index.cjs +1 -1
- package/dist/factory/index.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/logger/index.cjs +1 -1
- package/dist/logger/index.mjs +1 -1
- package/dist/plugins/index.cjs +1 -1
- package/dist/plugins/index.d.cts +166 -1
- package/dist/plugins/index.d.mts +166 -1
- package/dist/plugins/index.d.ts +166 -1
- package/dist/plugins/index.mjs +1 -1
- package/dist/shared/vite-plugin.B88RyRN8.mjs +3 -0
- package/dist/shared/vite-plugin.C7isVPKg.mjs +1 -0
- package/dist/shared/vite-plugin.D6NYITpX.cjs +1 -0
- package/dist/shared/vite-plugin.D8HTI0Ni.cjs +2 -0
- package/dist/shared/vite-plugin.Dd2ogbSe.mjs +2 -0
- package/dist/shared/vite-plugin.DqWt65U-.cjs +1 -0
- package/dist/shared/vite-plugin.HZb-1B5l.mjs +1 -0
- package/dist/shared/vite-plugin.IGZeStMa.cjs +3 -0
- package/package.json +72 -72
- package/dist/shared/vite-plugin.BT1oHRKK.cjs +0 -1
- package/dist/shared/vite-plugin.BTKhc7n7.cjs +0 -3
- package/dist/shared/vite-plugin.BZqhBDYR.mjs +0 -1
- package/dist/shared/vite-plugin.Bn8mcCzy.cjs +0 -3
- package/dist/shared/vite-plugin.CY2ydccp.mjs +0 -3
- package/dist/shared/vite-plugin.ClHiVXD6.mjs +0 -1
- package/dist/shared/vite-plugin.DSRKYuae.mjs +0 -3
- package/dist/shared/vite-plugin.DrSzERYS.cjs +0 -1
package/README-en.md
CHANGED
|
@@ -1,150 +1,164 @@
|
|
|
1
|
-
**English** | [中文](./README.md)
|
|
2
|
-
|
|
3
|
-
<div align="center">
|
|
4
|
-
<a href="https://github.com/MengXi-Studio/vite-plugin">
|
|
5
|
-
<img alt="梦曦工作室 Logo" width="215" src="https://github.com/MengXi-Studio/vite-plugin/blob/master/packages/docs/src/public/logo.svg">
|
|
6
|
-
</a>
|
|
7
|
-
<br>
|
|
8
|
-
<h1>@meng-xi/vite-plugin</h1>
|
|
9
|
-
|
|
10
|
-
[](LICENSE) [](https://www.npmjs.com/package/@meng-xi/vite-plugin)
|
|
11
|
-

|
|
12
|
-
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
> - This is a toolkit that provides practical plugins for Vite,
|
|
16
|
-
> - Extends Vite build process functionality, providing automated processing solutions for common build tasks.
|
|
17
|
-
> - All plugins support detailed configuration options, allowing customization based on project needs to meet different usage scenarios.
|
|
18
|
-
> - Plugins provide error handling mechanisms to ensure build processes can catch errors, improving build reliability.
|
|
19
|
-
> -
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
Start reading the [documentation](https://mengxi-studio.github.io/vite-plugin/).
|
|
24
|
-
|
|
25
|
-
## Quick Start
|
|
26
|
-
|
|
27
|
-
### Installation
|
|
28
|
-
|
|
29
|
-
Install `@meng-xi/vite-plugin` using a package manager:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
# Using npm
|
|
33
|
-
npm install @meng-xi/vite-plugin --save-dev
|
|
34
|
-
|
|
35
|
-
# Using yarn
|
|
36
|
-
yarn add @meng-xi/vite-plugin --save-dev
|
|
37
|
-
|
|
38
|
-
# Using pnpm
|
|
39
|
-
pnpm add @meng-xi/vite-plugin --save-dev
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### Basic Usage
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
```typescript
|
|
47
|
-
import { defineConfig } from 'vite'
|
|
48
|
-
import { copyFile, injectIco } from '@meng-xi/vite-plugin'
|
|
49
|
-
|
|
50
|
-
export default defineConfig({
|
|
51
|
-
plugins: [
|
|
52
|
-
// Copy file plugin
|
|
53
|
-
copyFile({
|
|
54
|
-
sourceDir: 'src/assets',
|
|
55
|
-
targetDir: 'dist/assets'
|
|
56
|
-
}),
|
|
57
|
-
|
|
58
|
-
// Inject icon plugin
|
|
59
|
-
injectIco({
|
|
60
|
-
base: '/assets'
|
|
61
|
-
})
|
|
62
|
-
]
|
|
63
|
-
})
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
- `
|
|
113
|
-
- `
|
|
114
|
-
- `
|
|
115
|
-
- `
|
|
116
|
-
- `
|
|
117
|
-
- `
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
git
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
1
|
+
**English** | [中文](./README.md)
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<a href="https://github.com/MengXi-Studio/vite-plugin">
|
|
5
|
+
<img alt="梦曦工作室 Logo" width="215" src="https://github.com/MengXi-Studio/vite-plugin/blob/master/packages/docs/src/public/logo.svg">
|
|
6
|
+
</a>
|
|
7
|
+
<br>
|
|
8
|
+
<h1>@meng-xi/vite-plugin</h1>
|
|
9
|
+
|
|
10
|
+
[](LICENSE) [](https://www.npmjs.com/package/@meng-xi/vite-plugin)
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
> - This is a toolkit that provides practical plugins for Vite, and also serves as a complete **Vite Plugin Development Framework**.
|
|
16
|
+
> - Extends Vite build process functionality, providing automated processing solutions for common build tasks.
|
|
17
|
+
> - All plugins support detailed configuration options, allowing customization based on project needs to meet different usage scenarios.
|
|
18
|
+
> - Plugins provide error handling mechanisms to ensure build processes can catch errors, improving build reliability.
|
|
19
|
+
> - Export core components like BasePlugin, Logger, Validator, allowing developers to build custom plugins based on the same infrastructure.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
Start reading the [documentation](https://mengxi-studio.github.io/vite-plugin/).
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
### Installation
|
|
28
|
+
|
|
29
|
+
Install `@meng-xi/vite-plugin` using a package manager:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Using npm
|
|
33
|
+
npm install @meng-xi/vite-plugin --save-dev
|
|
34
|
+
|
|
35
|
+
# Using yarn
|
|
36
|
+
yarn add @meng-xi/vite-plugin --save-dev
|
|
37
|
+
|
|
38
|
+
# Using pnpm
|
|
39
|
+
pnpm add @meng-xi/vite-plugin --save-dev
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Basic Usage
|
|
43
|
+
|
|
44
|
+
#### Using Built-in Plugins
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
import { defineConfig } from 'vite'
|
|
48
|
+
import { copyFile, injectIco } from '@meng-xi/vite-plugin'
|
|
49
|
+
|
|
50
|
+
export default defineConfig({
|
|
51
|
+
plugins: [
|
|
52
|
+
// Copy file plugin
|
|
53
|
+
copyFile({
|
|
54
|
+
sourceDir: 'src/assets',
|
|
55
|
+
targetDir: 'dist/assets'
|
|
56
|
+
}),
|
|
57
|
+
|
|
58
|
+
// Inject icon plugin
|
|
59
|
+
injectIco({
|
|
60
|
+
base: '/assets'
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
})
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Developing Custom Plugins
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import { BasePlugin, createPluginFactory, Validator } from '@meng-xi/vite-plugin'
|
|
70
|
+
import type { Plugin } from 'vite'
|
|
71
|
+
|
|
72
|
+
interface MyPluginOptions {
|
|
73
|
+
path: string
|
|
74
|
+
enabled?: boolean
|
|
75
|
+
verbose?: boolean
|
|
76
|
+
errorStrategy?: 'throw' | 'log' | 'ignore'
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
class MyPlugin extends BasePlugin<MyPluginOptions> {
|
|
80
|
+
protected getDefaultOptions() {
|
|
81
|
+
return {
|
|
82
|
+
path: './default'
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
protected validateOptions(): void {
|
|
87
|
+
this.validator.field('path').required().string().validate()
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
protected getPluginName(): string {
|
|
91
|
+
return 'my-plugin'
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
protected addPluginHooks(plugin: Plugin): void {
|
|
95
|
+
plugin.buildStart = () => {
|
|
96
|
+
this.logger.info(`Plugin started with path: ${this.options.path}`)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const myPlugin = createPluginFactory(MyPlugin)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Plugin Details
|
|
105
|
+
|
|
106
|
+
### copyFile Plugin
|
|
107
|
+
|
|
108
|
+
Used to copy files or directories to specified locations after Vite build is completed.
|
|
109
|
+
|
|
110
|
+
**Configuration Options**:
|
|
111
|
+
|
|
112
|
+
- `sourceDir`: Source directory path (required)
|
|
113
|
+
- `targetDir`: Target directory path (required)
|
|
114
|
+
- `overwrite`: Whether to overwrite existing files, default is `true`
|
|
115
|
+
- `recursive`: Whether to recursively copy subdirectories, default is `true`
|
|
116
|
+
- `verbose`: Whether to output detailed logs, default is `true`
|
|
117
|
+
- `enabled`: Whether to enable the plugin, default is `true`
|
|
118
|
+
|
|
119
|
+
### injectIco Plugin
|
|
120
|
+
|
|
121
|
+
Used to inject website icon links into the head of HTML files during the Vite build process.
|
|
122
|
+
|
|
123
|
+
**Configuration Options**:
|
|
124
|
+
|
|
125
|
+
- `base`: Base path for icon files
|
|
126
|
+
- `url`: Complete URL for the icon
|
|
127
|
+
- `link`: Custom complete link tag HTML
|
|
128
|
+
- `icons`: Custom icon array
|
|
129
|
+
- `verbose`: Whether to output detailed logs, default is `true`
|
|
130
|
+
- `enabled`: Whether to enable the plugin, default is `true`
|
|
131
|
+
- `copyOptions`: Icon file copying configuration
|
|
132
|
+
|
|
133
|
+
## Contribution
|
|
134
|
+
|
|
135
|
+
Welcome to contribute to `@meng-xi/vite-plugin`. Here are the steps to contribute code:
|
|
136
|
+
|
|
137
|
+
1. Fork the project: Fork this project on GitHub.
|
|
138
|
+
2. Clone the code: Clone the forked project to your local machine.
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
git clone https://github.com/your-username/vite-plugin.git
|
|
142
|
+
cd vite-plugin
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
3. Create a new branch: Create a new feature branch based on the `master` branch.
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
git checkout -b feature/your-feature
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
4. Commit changes: Ensure your code passes tests and commit your changes with clear commit messages.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
git add .
|
|
155
|
+
git commit -m "feat: add your feature description"
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
5. Push changes: Push your local branch to GitHub.
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
git push origin feature/your-feature
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
6. Create a PR: Create a Pull Request on GitHub and wait for review.
|
package/README.md
CHANGED
|
@@ -1,84 +1,143 @@
|
|
|
1
|
-
**中文** | [English](./README-en.md)
|
|
2
|
-
|
|
3
|
-
<div align="center">
|
|
4
|
-
<a href="https://github.com/MengXi-Studio/vite-plugin">
|
|
5
|
-
<img alt="梦曦工作室 Logo" width="215" src="https://github.com/MengXi-Studio/vite-plugin/blob/master/packages/docs/src/public/logo.svg">
|
|
6
|
-
</a>
|
|
7
|
-
<br>
|
|
8
|
-
<h1>@meng-xi/vite-plugin</h1>
|
|
9
|
-
|
|
10
|
-
[](LICENSE) [](https://www.npmjs.com/package/@meng-xi/vite-plugin)
|
|
11
|
-

|
|
12
|
-
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
## 简介
|
|
16
|
-
|
|
17
|
-
`@meng-xi/vite-plugin` 是一个为 Vite
|
|
18
|
-
|
|
19
|
-
## 特性
|
|
20
|
-
|
|
21
|
-
- **增强 Vite 构建流程**:提供实用插件集合,扩展 Vite 功能,简化构建过程中的常见任务,提高开发效率
|
|
22
|
-
-
|
|
23
|
-
- **高度可配置**:所有功能支持详细配置选项,可根据项目需求自定义行为,满足多样化场景
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- **无缝集成**:与 Vite 构建流程无缝集成,无需复杂配置即可快速启用
|
|
28
|
-
- **优化开发体验**:简化常见构建任务,减少手动操作,让开发者专注于核心业务逻辑
|
|
29
|
-
|
|
30
|
-
## 文档
|
|
31
|
-
|
|
32
|
-
开始阅读[文档地址](https://mengxi-studio.github.io/vite-plugin/)。
|
|
33
|
-
|
|
34
|
-
## 安装
|
|
35
|
-
|
|
36
|
-
使用包管理器安装 `@meng-xi/vite-plugin`:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
# 使用 npm
|
|
40
|
-
npm install @meng-xi/vite-plugin --save-dev
|
|
41
|
-
|
|
42
|
-
# 使用 yarn
|
|
43
|
-
yarn add @meng-xi/vite-plugin --save-dev
|
|
44
|
-
|
|
45
|
-
# 使用 pnpm
|
|
46
|
-
pnpm add @meng-xi/vite-plugin --save-dev
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
##
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
1
|
+
**中文** | [English](./README-en.md)
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<a href="https://github.com/MengXi-Studio/vite-plugin">
|
|
5
|
+
<img alt="梦曦工作室 Logo" width="215" src="https://github.com/MengXi-Studio/vite-plugin/blob/master/packages/docs/src/public/logo.svg">
|
|
6
|
+
</a>
|
|
7
|
+
<br>
|
|
8
|
+
<h1>@meng-xi/vite-plugin</h1>
|
|
9
|
+
|
|
10
|
+
[](LICENSE) [](https://www.npmjs.com/package/@meng-xi/vite-plugin)
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
## 简介
|
|
16
|
+
|
|
17
|
+
`@meng-xi/vite-plugin` 是一个为 Vite 提供实用插件的工具包,也是一个**完整的插件开发框架**。该框架提供了常用功能的核心工具方法供扩展支持其他拓展工作开展快速开发。
|
|
18
|
+
|
|
19
|
+
## 特性
|
|
20
|
+
|
|
21
|
+
- **增强 Vite 构建流程**:提供实用插件集合,扩展 Vite 功能,简化构建过程中的常见任务,提高开发效率
|
|
22
|
+
- **插件开发框架**:导出核心组件如 BasePlugin、Logger、Validator,允许开发者基于相同基础设施构建自定义插件
|
|
23
|
+
- **高度可配置**:所有功能支持详细配置选项,可根据项目需求自定义行为,满足多样化场景
|
|
24
|
+
- **单例日志系统**:统一的日志管理器,支持插件级别的日志控制,便于调试和问题排查
|
|
25
|
+
- **类型安全验证**:强类型配置验证器,确保插件配置正确性,提供完整的 TypeScript 类型定义
|
|
26
|
+
- **插件工厂模式**:支持选项标准化器,轻松处理异构输入,简化插件开发工作流
|
|
27
|
+
- **无缝集成**:与 Vite 构建流程无缝集成,无需复杂配置即可快速启用
|
|
28
|
+
- **优化开发体验**:简化常见构建任务,减少手动操作,让开发者专注于核心业务逻辑
|
|
29
|
+
|
|
30
|
+
## 文档
|
|
31
|
+
|
|
32
|
+
开始阅读[文档地址](https://mengxi-studio.github.io/vite-plugin/)。
|
|
33
|
+
|
|
34
|
+
## 安装
|
|
35
|
+
|
|
36
|
+
使用包管理器安装 `@meng-xi/vite-plugin`:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# 使用 npm
|
|
40
|
+
npm install @meng-xi/vite-plugin --save-dev
|
|
41
|
+
|
|
42
|
+
# 使用 yarn
|
|
43
|
+
yarn add @meng-xi/vite-plugin --save-dev
|
|
44
|
+
|
|
45
|
+
# 使用 pnpm
|
|
46
|
+
pnpm add @meng-xi/vite-plugin --save-dev
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 基本使用
|
|
50
|
+
|
|
51
|
+
### 使用内置插件
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import { defineConfig } from 'vite'
|
|
55
|
+
import { copyFile, injectIco } from '@meng-xi/vite-plugin'
|
|
56
|
+
|
|
57
|
+
export default defineConfig({
|
|
58
|
+
plugins: [
|
|
59
|
+
copyFile({
|
|
60
|
+
sourceDir: 'src/assets',
|
|
61
|
+
targetDir: 'dist/assets'
|
|
62
|
+
}),
|
|
63
|
+
injectIco({
|
|
64
|
+
base: '/assets'
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 开发自定义插件
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import { BasePlugin, createPluginFactory, Validator } from '@meng-xi/vite-plugin'
|
|
74
|
+
import type { Plugin } from 'vite'
|
|
75
|
+
|
|
76
|
+
interface MyPluginOptions {
|
|
77
|
+
path: string
|
|
78
|
+
enabled?: boolean
|
|
79
|
+
verbose?: boolean
|
|
80
|
+
errorStrategy?: 'throw' | 'log' | 'ignore'
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
class MyPlugin extends BasePlugin<MyPluginOptions> {
|
|
84
|
+
protected getDefaultOptions() {
|
|
85
|
+
return {
|
|
86
|
+
path: './default'
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
protected validateOptions(): void {
|
|
91
|
+
this.validator.field('path').required().string().validate()
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
protected getPluginName(): string {
|
|
95
|
+
return 'my-plugin'
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
protected addPluginHooks(plugin: Plugin): void {
|
|
99
|
+
plugin.buildStart = () => {
|
|
100
|
+
this.logger.info(`Plugin started with path: ${this.options.path}`)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const myPlugin = createPluginFactory(MyPlugin)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## 更新日志
|
|
109
|
+
|
|
110
|
+
[CHANGELOG](https://github.com/MengXi-Studio/vite-plugin/releases)
|
|
111
|
+
|
|
112
|
+
## 如何贡献
|
|
113
|
+
|
|
114
|
+
欢迎为 `@meng-xi/vite-plugin` 贡献代码。以下是贡献代码的步骤:
|
|
115
|
+
|
|
116
|
+
1. Fork 项目:在 GitHub 上 Fork 此项目。
|
|
117
|
+
2. 克隆代码:将 Fork 后的项目克隆到您的本地机器。
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
git clone https://github.com/your-username/vite-plugin.git
|
|
121
|
+
cd vite-plugin
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
3. 创建新分支:基于 `master` 分支创建一个新的功能分支。
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
git checkout -b feature/your-feature
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
4. 提交变更:确保您的代码通过了测试,并使用清晰的提交消息提交您的变更。
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
git add .
|
|
134
|
+
git commit -m "feat: add your feature description"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
5. Push 变更:将您的本地分支推送到 GitHub。
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
git push origin feature/your-feature
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
6. 创建 PR:在 GitHub 上创建一个 Pull Request,并等待审核。
|
package/dist/common/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const format=require("../shared/vite-plugin.D6NYITpX.cjs"),validation=require("../shared/vite-plugin.IGZeStMa.cjs");require("fs"),require("path"),require("crypto"),exports.checkSourceExists=format.checkSourceExists,exports.copySourceToTarget=format.copySourceToTarget,exports.ensureTargetDir=format.ensureTargetDir,exports.formatDate=format.formatDate,exports.generateRandomHash=format.generateRandomHash,exports.getDateFormatParams=format.getDateFormatParams,exports.padNumber=format.padNumber,exports.parseTemplate=format.parseTemplate,exports.readDirRecursive=format.readDirRecursive,exports.readFileSync=format.readFileSync,exports.shouldUpdateFile=format.shouldUpdateFile,exports.writeFileContent=format.writeFileContent,exports.Validator=validation.Validator,exports.deepMerge=validation.deepMerge;
|