Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make rollup an optional peer dependency #209

Closed
chrispcampbell opened this issue Jul 8, 2022 · 1 comment · Fixed by #214 or #213
Closed

Make rollup an optional peer dependency #209

chrispcampbell opened this issue Jul 8, 2022 · 1 comment · Fixed by #214 or #213

Comments

@chrispcampbell
Copy link
Contributor

chrispcampbell commented Jul 8, 2022

Currently the plugin-check and plugin-worker packages relies on a couple Rollup plugins that are used in the Vite config (at runtime, meaning during the sde bundle/dev process). These don't actually need rollup when used via vite, but they still list rollup as a required peer dependency, which causes issues when installing via pnpm (see below).

hello-world campbell$ pnpm i
 WARN  deprecated rollup-plugin-inject@3.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
Already up-to-date
 ERR_PNPM_PEER_DEP_ISSUES  Unmet peer dependencies

.
└─┬ @sdeverywhere/plugin-check
  ├─┬ @rollup/plugin-node-resolve
  │ ├── ✕ missing peer rollup@^2.42.0
  │ └─┬ @rollup/pluginutils
  │   └── ✕ missing peer rollup@^1.20.0||^2.0.0
  └─┬ @rollup/plugin-replace
    └── ✕ missing peer rollup@"^1.20.0 || ^2.0.0"
Peer dependencies that should be installed:
  rollup@">=2.42.0 <3.0.0"  

We may be able to avoid this by marking rollup as optional using peerDependenciesMeta.

@chrispcampbell
Copy link
Contributor Author

The peerDependenciesMeta approach doesn't work because it only applies to the current package, not transitive dependencies (see related comment from pnpm author).

We can instead just list rollup as a dependency in plugin-check and plugin-worker even though it is technically not needed. This will help avoid making consumers have to worry about peer dependency issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment