Skip to content

Commit

Permalink
adapt docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Nov 18, 2022
1 parent d21e596 commit 2c42949
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions docs/999-big-list-of-options.md
Expand Up @@ -1717,20 +1717,22 @@ This can not only help with dead code removal, but can also improve JavaScript c
export default {
treeshake: {
preset: 'smallest',
manualPureFunctions: ['foo', 'bar.baz']
manualPureFunctions: ['styled.div', 'local']
}
// ...
};

// code
import { lib as bar } from 'external';
const foo = console.log;

foo(); // removed
bar.baz(); // removed
bar(); // not removed
bar.quuz(); // not removed
bar?.baz(); // not removed
import styled from 'styled-components';
const local = console.log;

local(); // removed
styled.div`
color: blue;
`; // removed
styled?.div(); // removed
styled(); // not removed
styled.h1(); // not removed
```
**treeshake.moduleSideEffects**<br> Type: `boolean | "no-external" | string[] | (id: string, external: boolean) => boolean`<br> CLI: `--treeshake.moduleSideEffects`/`--no-treeshake.moduleSideEffects`/`--treeshake.moduleSideEffects no-external`<br> Default: `true`
Expand Down

0 comments on commit 2c42949

Please sign in to comment.