Skip to content

Commit

Permalink
fix(): Rollup and exports.
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanCQ committed Dec 18, 2023
1 parent 851e4fa commit e7450ad
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
3 changes: 3 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./src";
import _theme from "./tailwind.config";
export const theme = _theme;
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"module": "dist/src/index.js",
"module": "dist/index.js",
"files": [
"dist"
],
Expand Down Expand Up @@ -52,7 +52,7 @@
"react-dom": "^18.2.0",
"rollup": "^2.75.6",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-dts": "^4.2.2",
"rollup-plugin-dts": "^4.2.3",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-replace": "^2.2.0",
Expand Down
9 changes: 3 additions & 6 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import postcss from "rollup-plugin-postcss";
import { terser } from "rollup-plugin-terser";
export default [
{
input: "src/index.ts",
input: "index.ts",
output: [
{
dir: "dist/",
format: "esm",
sourcemap: true,
preserveModules: true,
// preserveModules: true,
},
],
plugins: [
Expand All @@ -23,15 +22,13 @@ export default [
// Create typescript definitions.
typescript({
tsconfig: "./tsconfig.json",
declarationDir: "dist/types",
}),
// CSS vendor prefixing etc.
postcss({
extract: path.resolve("./dist/tokens.css"),
config: "./postcss.config.js",
}),
// copy({
// targets: [{ src: "./src/styles.css", dest: "./dist" }],
// }),
// Minify output.
terser(),
],
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from "../tailwind.config";
export * from "./atoms/accordion";
export * from "./atoms/alert";
export * from "./atoms/alert-dialog";
Expand Down Expand Up @@ -42,4 +41,3 @@ export * from "./atoms/use-toast";
export * from "./molecules/slide-in";
export * from "./molecules/theme-selector";
export * from "./utils";
import "./tokens.css";
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"jsx": "react-jsx",
"module": "ESNext",
"declaration": true,

"sourceMap": true,
"outDir": "dist",
"moduleResolution": "node",
Expand Down

0 comments on commit e7450ad

Please sign in to comment.