Skip to content

Commit

Permalink
Version_0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
censujiang committed Jul 23, 2023
1 parent d705999 commit 13ad019
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ export function globalConst(config) {
return {
name: 'vite-plugin-global-const',
config() {
const define = defineConst(config);
const define = defineConstCore(config);
return {
define,
};
},
};
}
function defineConst(config) {
export function defineConstCore(config) {
const define = {};
for (const key in config) {
define[`import.meta.env.${key}`] = JSON.stringify(config[key]);
Expand Down
1 change: 1 addition & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ interface Config {
[key: string]: any;
}
export declare function globalConst(config: Config): Plugin;
export declare function defineConstCore(config: Config): {};
export {};

0 comments on commit 13ad019

Please sign in to comment.