Skip to content

Commit e7450ad

Browse files
committed
fix(): Rollup and exports.
1 parent 851e4fa commit e7450ad

6 files changed

+10
-11
lines changed

index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from "./src";
2+
import _theme from "./tailwind.config";
3+
export const theme = _theme;

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"publishConfig": {
1818
"registry": "https://npm.pkg.github.com"
1919
},
20-
"module": "dist/src/index.js",
20+
"module": "dist/index.js",
2121
"files": [
2222
"dist"
2323
],
@@ -52,7 +52,7 @@
5252
"react-dom": "^18.2.0",
5353
"rollup": "^2.75.6",
5454
"rollup-plugin-copy": "^3.4.0",
55-
"rollup-plugin-dts": "^4.2.2",
55+
"rollup-plugin-dts": "^4.2.3",
5656
"rollup-plugin-peer-deps-external": "^2.2.4",
5757
"rollup-plugin-postcss": "^4.0.2",
5858
"rollup-plugin-replace": "^2.2.0",

rollup.config.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ import postcss from "rollup-plugin-postcss";
66
import { terser } from "rollup-plugin-terser";
77
export default [
88
{
9-
input: "src/index.ts",
9+
input: "index.ts",
1010
output: [
1111
{
1212
dir: "dist/",
1313
format: "esm",
14-
sourcemap: true,
15-
preserveModules: true,
14+
// preserveModules: true,
1615
},
1716
],
1817
plugins: [
@@ -23,15 +22,13 @@ export default [
2322
// Create typescript definitions.
2423
typescript({
2524
tsconfig: "./tsconfig.json",
25+
declarationDir: "dist/types",
2626
}),
2727
// CSS vendor prefixing etc.
2828
postcss({
2929
extract: path.resolve("./dist/tokens.css"),
3030
config: "./postcss.config.js",
3131
}),
32-
// copy({
33-
// targets: [{ src: "./src/styles.css", dest: "./dist" }],
34-
// }),
3532
// Minify output.
3633
terser(),
3734
],

src/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export * from "../tailwind.config";
21
export * from "./atoms/accordion";
32
export * from "./atoms/alert";
43
export * from "./atoms/alert-dialog";
@@ -42,4 +41,3 @@ export * from "./atoms/use-toast";
4241
export * from "./molecules/slide-in";
4342
export * from "./molecules/theme-selector";
4443
export * from "./utils";
45-
import "./tokens.css";

tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"jsx": "react-jsx",
1212
"module": "ESNext",
1313
"declaration": true,
14+
1415
"sourceMap": true,
1516
"outDir": "dist",
1617
"moduleResolution": "node",

0 commit comments

Comments
 (0)