Skip to content

Lazy definition

Compare
Choose a tag to compare
@dntzhang dntzhang released this 03 Dec 10:09
· 133 commits to master since this release

If we are writing a component library and need to use tree shaking capabilities,

import { WeButton } from 'ui-lib' 

It could lead to definition failure if Button is not used, as it would be tree-shaken away. Therefore, we need to use Button, for example,

WeButton.define('we-button')