I have a custom npm package with a peer dependency on element-ui.
This package is importing the Pagination component from element-ui:
import {Pagination} from 'element-ui';'
However, when I import this component in my project, the entire element-ui library gets included in the generated js file instead of just Pagination.
My assets are built using Laravel mix, and here's a snippet from webpack.mix.js:
babel: {
"presets": [
["es2015", {"modules": false, "targets": {
"browsers": ["> 5%", "ie >= 9"]
}}]
],
"plugins": [["component", [
{
"libraryName": "element-ui",
"styleLibraryName": "theme-default"
}
]]]
}
Interestingly, when I directly import the same Pagination component in my project (not from the custom package), it behaves correctly by only importing Pagination itself.
Any insights into why this might be happening would be greatly appreciated. Thank you!