From 5fdda7eeee2cb1738228a93765a9eecb7e32f1dd Mon Sep 17 00:00:00 2001 From: tedspare Date: Wed, 2 Oct 2024 16:25:11 -0400 Subject: [PATCH] Bundle css --- CHANGELOG.md | 1 + build.ts | 12 ++++++------ package.json | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bd6d06..d37eef8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +- [2024-10-02] [Bundle css](https://github.com/RubricLab/ui/commit/343655090d6f68bf065807a4552a655a5b660517) - [2024-10-02] [Bundle index.ts](https://github.com/RubricLab/ui/commit/1b141ca0383cd61cd0d481a3008f3b122cdb3544) - [2024-10-02] [Bundle in components](https://github.com/RubricLab/ui/commit/82009ba695e187560eb4a833a6dc3b25baf67fe3) - [2024-10-02] [Bundle index.ts](https://github.com/RubricLab/ui/commit/4de8280c96873fb326fea0b68f83b33cbb4842c8) diff --git a/build.ts b/build.ts index 8327a73..8478a56 100644 --- a/build.ts +++ b/build.ts @@ -1,10 +1,10 @@ import { rm, rename, readdir } from "node:fs/promises"; import path from "node:path"; -const distDir = "./dist"; +const outdir = "./dist"; // Clean dist directory before building -await rm(distDir, { +await rm(outdir, { recursive: true, force: true, }); @@ -14,7 +14,7 @@ try { // Run build await Bun.build({ entrypoints: ["./src/index.ts"], - outdir: "./dist", + outdir, minify: true, external: ["react", "react-dom"], }); @@ -24,10 +24,10 @@ try { } // Rename the generated CSS file to index.css -const files = await readdir(distDir); +const files = await readdir(outdir); const cssFile = files.find((file) => file.endsWith(".css")); if (cssFile) { - const oldPath = path.join(distDir, cssFile); - const newPath = path.join(distDir, "index.css"); + const oldPath = path.join(outdir, cssFile); + const newPath = path.join(outdir, "index.css"); await rename(oldPath, newPath); } \ No newline at end of file diff --git a/package.json b/package.json index 9f93d36..3a8ab45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rubriclab/ui", - "version": "5.0.7", + "version": "5.0.8", "main": "dist/index.js", "types": "src/index.ts", "description": "UI package by Rubric Labs", @@ -23,7 +23,7 @@ "dist/*.js", "dist/*.d.ts", "dist/*.css", - "src/**/*.{ts,tsx}", + "src/**/*.tsx", "bin/commands", "bin/config" ],