I was looking into the following link.
After following the instructions, I realized I am using class based components. Therefore, I am importing as shown below:
import {Checkbox} from 'element-ui';
@Component({
components: { Checkbox
}
})
export default class Work extends Vue {
}
However, the bundle still seems to be including the entire element ui library, instead of just the button component.
When I run npm run build, it generates a vendor chunk of 800+ kb, which includes code for other components like color-picker.
The instructions mention editing the .babelrc file as shown below:
{
"presets": [["es2015", { "modules": false }]],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
}
Since I am not using components globally as a plugin, I have not made that change.
Is there a way to reduce the element ui bundle size and include only the required components to make the vendor chunks smaller?