-
-
Notifications
You must be signed in to change notification settings - Fork 78
Closed
Description
Checklist
- I can reproduce this issue when running this plugin on its own.
Other plugins, such asnode-resolve
are known to cause issues. - I am running this plugin on
.d.ts
files generated by TypeScript.
The plugin can consume.ts
and even.js
files (withallowJs: true
), but this is known to cause issues. - This issue is not related to rolling up
@types
.
The plugin ignores these by default, unlessrespectExternal
is set.@types
can contain hand-crafted code which is known to cause issues.
Notes
- I'm following https://plainenglish.io/blog/react-component-library-with-ts-and-rollup-77aca0c727bf#rollupconfigjs
- https://stackoverflow.com/a/74304876 fixes the issue, but I thought I would log the issue since the README suggests the approach in the blog post I was following.
Dependency versions
"devDependencies": {
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.4.0",
"@rollup/plugin-typescript": "^11.0.0",
"@types/react": "^18.0.27",
"classnames": "^2.3.2",
"react": "^18.2.0",
"rollup": "^3.14.0",
"rollup-plugin-dts": "^5.1.1",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"tslib": "^2.5.0",
"typescript": "^4.9.5"
}
Code Snipped
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import terser from "@rollup/plugin-terser";
import external from "rollup-plugin-peer-deps-external";
import postcss from "rollup-plugin-postcss";
import dts from "rollup-plugin-dts";
const packageJson = require("./package.json");
export default [
{
input: "src/index.ts",
output: [
{
file: packageJson.main,
format: "cjs",
sourcemap: true,
name: 'kingdom-ui',
},
{
file: packageJson.module,
format: "esm",
sourcemap: true,
},
],
plugins: [
external(),
resolve(),
commonjs(),
typescript({ tsconfig: "./tsconfig.json" }),
postcss(),
terser(),
],
},
{
input: "dist/esm/types/index.d.ts",
output: [{ file: "dist/index.d.ts", format: "esm" }],
external: [/\.css$/],
plugins: [dts()],
},
];
Error Message
[!] TypeError: dts is not a function
mrkelder, ZhengRui, stefanonepanedap and RoyChenPT
Metadata
Metadata
Assignees
Labels
No labels