Skip to content

Commit

Permalink
type: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxian521 committed Jun 23, 2022
1 parent e4bfa74 commit fd7ba12
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Plugin } from "vite";

declare module "vite-plugin-remove-console" {
interface Options {
/** Don't remove console.log these modules */
external?: Array<string>;
}
function removeConsole(options?: Partial<Options>): Plugin;
export { removeConsole as default };
}
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface Options {
external?: Array<string>;
}

const removeConsole = (options?: Partial<Options>): Plugin => {
module.exports = function removeConsole(options?: Partial<Options>): Plugin {
const { external } = options || {};
return {
name: "vite:remove-console",
Expand All @@ -29,4 +29,4 @@ const removeConsole = (options?: Partial<Options>): Plugin => {
};
};

export default removeConsole;
module.exports.default = module.exports;

0 comments on commit fd7ba12

Please sign in to comment.