Skip to content

Commit 44cf21a

Browse files
committed
Fixed rollup config and errors
1 parent 4a01206 commit 44cf21a

File tree

2 files changed

+37
-30
lines changed

2 files changed

+37
-30
lines changed

rollup.config.js

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,39 @@ import postcss from "rollup-plugin-postcss";
77
const packageJson = require("./package.json");
88

99
export default [
10-
{
11-
input: "src/index.ts",
12-
output: [
13-
{
14-
file: packageJson.main,
15-
format: "cjs",
16-
sourcemap: true,
17-
},
18-
{
19-
file: packageJson.module,
20-
format: "esm",
21-
sourcemap: true,
22-
},
23-
],
24-
plugins: [
25-
resolve(),
26-
commonjs(),
27-
typescript({ tsconfig: "./tsconfig.json" }),
28-
postcss(),
29-
],
30-
external: ["react", "react-dom"],
31-
},
32-
{
33-
input: "dist/esm/types/index.d.ts",
34-
output: [{ file: "dist/index.d.ts", format: "esm" }],
35-
plugins: [dts()],
36-
external: [/\.(css|less|scss)$/],
37-
},
38-
];
10+
{
11+
input: "src/index.ts",
12+
output: [
13+
{
14+
file: packageJson.main,
15+
format: "cjs",
16+
sourcemap: true,
17+
exports: "auto",
18+
},
19+
{
20+
file: packageJson.module,
21+
format: "esm",
22+
sourcemap: true,
23+
},
24+
],
25+
plugins: [
26+
resolve(),
27+
commonjs(),
28+
typescript({ tsconfig: "./tsconfig.json" }),
29+
typescript({
30+
tsconfig: "./tsconfig.json",
31+
declaration: true,
32+
declarationDir: "dist",
33+
outputToFilesystem: true, // Required for proper type output in Rollup 4
34+
}),
35+
postcss(),
36+
],
37+
external: ["react", "react-dom"],
38+
},
39+
{
40+
input: "dist/esm/types/index.d.ts",
41+
output: [{ file: "dist/index.d.ts", format: "esm" }],
42+
plugins: [dts()],
43+
external: [/\.(css|less|scss)$/],
44+
},
45+
];

src/components/LinePart/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface LinePartCss {
1010
underline?: boolean;
1111
email?: boolean;
1212
link?: boolean;
13-
text: string;
13+
text?: string;
1414
wrapLine?: boolean;
1515
[key: string]: any;
1616
}

0 commit comments

Comments
 (0)