Skip to content

Commit

Permalink
Suppress circular dependency warnings by default (#139)
Browse files Browse the repository at this point in the history
Issue #131
  • Loading branch information
marijnh authored Mar 5, 2021
1 parent d290c70 commit 9a94d54
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const plugin: PluginImpl<Options> = (options = {}) => {
name: "dts",

options(options) {
let { input = [] } = options;
let { input = [], onwarn } = options;
if (!Array.isArray(input)) {
input = typeof input === "string" ? [input] : Object.values(input);
} else if (input.length > 1) {
Expand All @@ -100,6 +100,12 @@ const plugin: PluginImpl<Options> = (options = {}) => {

return {
...options,
onwarn(warning, warn) {
if (warning.code != "CIRCULAR_DEPENDENCY") {
if (onwarn) onwarn(warning, warn)
else warn(warning)
}
},
treeshake: {
moduleSideEffects: "no-external",
propertyReadSideEffects: true,
Expand Down

0 comments on commit 9a94d54

Please sign in to comment.