Skip to content

Commit f8f6e78

Browse files
committed
chore: add changeset
1 parent 9c6a7b3 commit f8f6e78

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.changeset/hungry-toys-care.md

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
"flowbite-react": patch
3+
---
4+
5+
## Rework build process using `rollup` and `tsc`
6+
7+
### Summary
8+
9+
In order to bring more performance to the build process of `flowbite-react` package we have to consider transpiling the files using other tools rather than `tsc`, which is very slow.
10+
11+
After a lot of trials with `tsup`, `tshy` or even `bun build`, finally ended up using `rollup` with `esbuild` plugin for transpiling and stuck with `tsc` only for `*.d.ts` declaration files generation.
12+
13+
### Changes
14+
15+
- added `rollup` + `esbuild` for transpiling files
16+
- all files in the `cjs` directory now have `.cjs` extention
17+
- all files in the `esm` directory now have `.mjs` extention
18+
- declaration file types (`*.d.ts`) have been moved from `dist/esm` to `dist/types`
19+
- changed the build output dir from `lib` to `dist`
20+
- created a facade layer for easier management of the `content` path as well as the `plugin`
21+
- fixed turbo repo dependency tree configs in order for `apps/web` to properly pipe and require the build output of `packages/ui` in certain script steps (such as: `build`, `dev`)
22+
23+
### Breaking changes
24+
25+
`tailwind.config.js` `content` path:
26+
27+
old: `"node_modules/flowbite-react/lib/esm/**/*.js"`
28+
29+
new: `"node_modules/flowbite-react/dist/esm/**/*.mjs"` - (`flowbite.content()` returns it)
30+
31+
Before
32+
33+
```js {5,9}
34+
/** @type {import('tailwindcss').Config} */
35+
module.exports = {
36+
content: [
37+
// ...
38+
"node_modules/flowbite-react/lib/esm/**/*.js",
39+
],
40+
plugins: [
41+
// ...
42+
require("flowbite/plugin"),
43+
],
44+
};
45+
```
46+
47+
After
48+
49+
```js {1,7,11}
50+
const flowbite = require("flowbite-react/tailwind");
51+
52+
/** @type {import('tailwindcss').Config} */
53+
module.exports = {
54+
content: [
55+
// ...
56+
flowbite.content(),
57+
],
58+
plugins: [
59+
// ...
60+
flowbite.plugin(),
61+
],
62+
};
63+
```

0 commit comments

Comments
 (0)