Skip to content

Commit

Permalink
docs: treeShaking default true
Browse files Browse the repository at this point in the history
  • Loading branch information
Jevon617 authored Jul 12, 2024
1 parent 47e2d78 commit 9c32d70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ import type { SvgName } from '~virtual/svg-component'
| optimizeOptions | `SvgoOptions` | - | svgo optimize [Options](https://github.com/svg/svgo) |
| svgSpriteDomId | `string` | __svg_sprite__dom__ | Customize the ID of the svgDom |
| vueVersion | `2 \| 3 \| auto` | auto | Vue version |
| treeShaking | `boolean` | false | whether enable tree-shaking |
| treeShaking | `boolean` | true | whether enable tree-shaking |
| scanGlob | `string[]` | [look this way](./src/core/utils.ts/#L41) | the glob pattern used in tree-shaking |
| scanStrategy | `text \| component \| (code: string[], options: Options)=>string[]` | component | the strategy used for tree-shaking will not be bundled into the final bundle if it is not successfully matched. The `text` option indicates matching by svg name, so you should ensure the uniqueness of your svg name (you can consider customizing it with the 'symbolIdFormatter' option) to avoid erroneous tree-shaking, while the default value of the `component` option indicates matching by component as a whole, In addition, you can also implement a tree-shaking strategy by passing a function whose return value represents the set of SVG icons used. |
| domInsertionStrategy | `replaceHtml \| dynamic` | `replaceHtml` | controls the method of injecting SVG elements, `replaceHtml(default)`: Injects the SVG elements by replacing the HTML string in server. `dynamic`: Injects the SVG elements through JavaScript dynamically in client. **Warning: if you are in ssr mode, you should use `replaceHtml` strategy.**|
Expand Down

0 comments on commit 9c32d70

Please sign in to comment.