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

docs: add clarity to the .default import pattern #275

Closed
wants to merge 1 commit into from

Conversation

spiltbeans
Copy link
Contributor

Describing the problem

If you import the plugin as directed in the docs you may encounter a console error like:

import dts from "rollup-plugin-dts";

const config = [
  // …
  {
    input: "./my-input/index.d.ts",
    output: [{ file: "dist/my-library.d.ts", format: "es" }],
    plugins: [dts()],
  },
];

export default config;
[!] TypeError: dts is not a function

And you will be returned this if you log dts to the console:

{ default: [Function: plugin] }

This is a recorded issue in #247.

Describing the solution

This PR modifies the usage portion of the README.md file to include documentation on how to handle this error by using the package with dts.default(). This PR also includes sources to the issue within the README.md.

Describing changes to the package

This PR only changes the documentation in the README.md and does not affect implementation.

@spiltbeans
Copy link
Contributor Author

I've created an alternate PR in #274 to solve the same issue. They are different solutions and only one should be accepted.

@Swatinem
Copy link
Owner

closing in favor of #274

@Swatinem Swatinem closed this Jul 31, 2023
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 this pull request may close these issues.

2 participants