Skip to content

Commit

Permalink
feat: 修复问题
Browse files Browse the repository at this point in the history
  • Loading branch information
jianbing.chen committed Aug 3, 2024
1 parent 86a01ef commit 29cb593
Show file tree
Hide file tree
Showing 14 changed files with 6,292 additions and 5 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
dist
docs-dist

.DS_Store
Expand Down
3 changes: 3 additions & 0 deletions dist/cjs/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Options } from './types';
import { UserOptions } from 'vite-plugin-externals/dist/src/types';
export declare function VitePluginExternals(options?: Options, userOptions?: UserOptions): Promise<{}>;
107 changes: 107 additions & 0 deletions dist/cjs/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/cjs/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions dist/cjs/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* 类型定义
*/
export interface External {
[key: string]: {
/** 远程地址 */
src?: string;
/** 变量名称 */
varName: string;
/** 脚本注入位置 */
inject?: 'head' | 'body';
/** 是否为defer */
defer?: boolean;
/** 是否为async */
async?: boolean;
};
}
export type Options = Partial<External>;
3 changes: 3 additions & 0 deletions dist/esm/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Options } from './types';
import { UserOptions } from 'vite-plugin-externals/dist/src/types';
export declare function VitePluginExternals(options?: Options, userOptions?: UserOptions): Promise<{}>;
81 changes: 81 additions & 0 deletions dist/esm/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/esm/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions dist/esm/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* 类型定义
*/
export interface External {
[key: string]: {
/** 远程地址 */
src?: string;
/** 变量名称 */
varName: string;
/** 脚本注入位置 */
inject?: 'head' | 'body';
/** 是否为defer */
defer?: boolean;
/** 是否为async */
async?: boolean;
};
}
export type Options = Partial<External>;
1 change: 1 addition & 0 deletions example/vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"vite-plugin-externals-new": "^1.5.1",
"vue": "^3.3.4",
"vue-router": "^4.2.4"
},
Expand Down
Loading

0 comments on commit 29cb593

Please sign in to comment.