Skip to content

Commit

Permalink
fix: ignore rollup warning if silent is true (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
dusionlike committed Oct 6, 2022
1 parent d074dd9 commit fb248e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/index.ts
Expand Up @@ -234,6 +234,7 @@ export async function build(_options: Options) {
treeShakingPlugin({
treeshake: options.treeshake,
name: options.globalName,
silent: options.silent,
}),
cjsSplitting(),
es5(),
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/tree-shaking.ts
Expand Up @@ -9,10 +9,12 @@ export type TreeshakingStrategy =

export const treeShakingPlugin = ({
treeshake,
name
name,
silent,
}: {
treeshake?: TreeshakingStrategy,
name?: string
silent?: boolean
}): Plugin => {
return {
name: 'tree-shaking',
Expand All @@ -38,6 +40,7 @@ export const treeShakingPlugin = ({
treeshake: treeshake,
makeAbsoluteExternalsRelative: false,
preserveEntrySignatures: 'exports-only',
onwarn: silent ? () => {} : undefined,
})

const result = await bundle.generate({
Expand Down

0 comments on commit fb248e4

Please sign in to comment.