pmowrer / rollup-plugin-peer-deps-external

Automatically externalize `peerDependencies` in a rollup bundle.
MIT License
109 stars 16 forks source link

Rollup 3.0 #58

Open brightsider opened 2 years ago

brightsider commented 2 years ago

Update for rollup 3.0 pls

melissarh57 commented 1 year ago

agreed, would love that!

chrisn commented 1 year ago

I got this working with Rollup 3.x, see https://github.com/chrisn/rollup-plugin-peer-deps-external/ - also available in NPM at https://www.npmjs.com/package/@chrisneedham/rollup-plugin-peer-deps-external.

@pmowrer You're welcome to take the changes I made to publish your own update.

vveisard commented 2 months ago

I also had a problem during migration, and to be honest, this plugin isn't necessary anymore with import attributes:

import packageJson from './package.json' with { type: 'json'};
import { defineConfig } from "rollup";

const peerDependencies = Object.keys(packageJson.peerDependencies)

export default defineConfig([
  {
    input: "./source/code/index.ts",
    external: [
      ...peerDependencies
    ],
  },
]);