Closed basbroens closed 1 year ago
Hi @basbroens, indeed, I will update the documentation shortly as index.js
needs to be specified in wave-ui/src/wave-ui/components/index.js
when used from outside of the Wave UI project.
Here is a StackBlitz demo where only the WButton, WAlert, WIcon
components are loaded, and where using the w-rating component would raise a Vue warning saying the component is undefined.
The tree shaking will be done automatically on build when you don't import the components you don't need.
https://stackblitz.com/edit/waveui-3-tree-shaking?file=package.json,src%2Fmain.js,src%2FApp.vue
Hope this helps :)
Hi @basbroens I have also exposed the /components
alias, so both paths will work now. cheers.
thnx so much for your help
I'm trying to use the treeshaking option, but on build a get an error:
Rollup failed to resolve import "wave-ui/src/wave-ui/components" from "C:/code/www/kdsv3/src/main.js".
Probably i'm doing something wrong with the file imports in main.js
`import WaveUI from 'wave-ui/src/wave-ui/core'
import { WButton } from 'wave-ui/src/wave-ui/components'; import { WDialog } from 'wave-ui/src/wave-ui/components';`
What am i missing? :)