Skip to content

Commit 87e8632

Browse files
authored
Merge pull request #3 from chengpeiquan/develop
Update: Modify the return type.
2 parents d31efc1 + 3b86b9b commit 87e8632

File tree

7 files changed

+9
-10
lines changed

7 files changed

+9
-10
lines changed

dist/main.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
import type { Plugin } from 'vite';
2-
declare const banner: (comment: string) => Plugin | unknown;
1+
declare const banner: (comment: string) => any;
32
export default banner;

dist/vite-plugin-banner.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vite-plugin-banner.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vite-plugin-banner.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vite-plugin-banner.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vite-plugin-banner",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"description": "A banner plugin for Vite. Adds a banner to the top of each generated chunk.",
55
"main": "dist/vite-plugin-banner.min.js",
66
"types": "dist/main.d.ts",

src/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fs from 'fs'
22
import { resolve } from 'path'
3-
import type { Plugin, ResolvedConfig } from 'vite'
3+
import type { ResolvedConfig } from 'vite'
44
import checkComment from './checkComment'
55

66
// 来自vite.config.ts的配置继承
@@ -16,7 +16,7 @@ const excludeRegexp: RegExp = new RegExp(/vendor/);
1616
* 给文件添加banner注释
1717
* @param {string} comment - 注释的内容,可以包含注释符号,也可以只传内容
1818
*/
19-
const banner = (comment: string): Plugin | unknown => {
19+
const banner = (comment: string): any => {
2020
// 校验传入的注释内容合法性
2121
const error: string = checkComment(comment);
2222
if ( error ) {
@@ -29,7 +29,7 @@ const banner = (comment: string): Plugin | unknown => {
2929
configResolved (resolvedConfig: ResolvedConfig) {
3030
viteConfig = resolvedConfig;
3131
},
32-
async writeBundle (options: unknown, bundle: unknown) {
32+
async writeBundle (options: any, bundle: any) {
3333
for ( const file of Object.entries(bundle) ) {
3434
// 获取文件路径
3535
const root: string = viteConfig.root;

0 commit comments

Comments
 (0)