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

Rollup v3 support #226

Closed
Mister-Hope opened this issue Oct 11, 2022 · 6 comments
Closed

Rollup v3 support #226

Mister-Hope opened this issue Oct 11, 2022 · 6 comments

Comments

@Mister-Hope
Copy link
Contributor

https://github.com/rollup/rollup/tree/v3.0.0

├─┬ rollup-plugin-dts 4.2.3
│ └── ✕ unmet peer rollup@^2.55: found 3.0.0
packages/shared build: ./src/node/index.ts → ./lib/node/index.d.ts...
packages/shared build: (!) The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.
packages/shared build: [!] RollupError: Invalid value false for option "output.interop" - use one of "compat", "auto", "esModule", "default", "defaultOnly".
packages/shared build: https://rollupjs.org/guide/en/#outputinterop
packages/shared build: RollupError: Invalid value false for option "output.interop" - use one of "compat", "auto", "esModule", "default", "defaultOnly".
@Swatinem
Copy link
Owner

ah yes, the peer dependency says that the plugin is not (yet) compatible with rollup 3. Which is brand new I see ;-)

I believe node/npm changed the way they treat peerDependencies a while back, I will have to dig into how to properly use that.

@pi0
Copy link
Contributor

pi0 commented Oct 13, 2022

There seems also some configuration updates. PR: #227


A really really ugly workaround for rollup@3 support in meantime:

    const dtsPlugin = dts(...)
    rollupOptions.plugins.push({
      ...dtsPlugin,
      outputOptions (...args) {
        const opts = dtsPlugin.outputOptions(...args)
        opts.interop = 'esModule'
        delete opts.namespaceToStringTag
        opts.generatedCode = { symbols: false, ...opts.generatedCode }
        return opts
      }
    })

@nicolas377
Copy link

There isn't really a workaround needed for v3 support for right now. Rollup only reports a warning, and the outputted code isn't affected. Obviously, the PR should still be merged. Just putting this out there for onlookers.

@Mister-Hope
Copy link
Contributor Author

Mister-Hope commented Oct 14, 2022

Rollup only reports a warning, and the outputted code isn't affected.

why am I unable to have it work? From the log I provided, rollup gives an error with output.interop. (I haven’t tested with later v3 yet, is this changed?)

@nicolas377
Copy link

nicolas377 commented Oct 14, 2022

That's weird. I used rollup-plugin-dts 4.2.3 with rollup 3.1.0 and npm i --force and it worked just fine.

@Swatinem
Copy link
Owner

Just published 5.0.0 which supports/requires rollup 3, and also raises the minimum supported node version to 14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants