Externalizes all dependencies
and peerDependencies
and makes sure all used dependencies are declared in the package.json
. Error out for any used dependencies that are not declared in package.json.
npm i --save-dev @element/rollup-plugin-external
Include this plugin as the first plugin within rollup.config.js
:
import { externalPackages } from '@element/rollup-plugin-external';
export default {
input: /* ... */,
output: [/* ... */],
plugins: [
externalPackages(),
// Other plugins
],
};