@nextbitlabs/nextbit-ui
v2.3.0
Published
A design system for the Nextbit pages written in React
Downloads
31
Readme
Nextbit UI
This project contains the UI
Usage example: run and develop locally - src-doc
Install and code:
yarn install
yarn start
Build the src-doc (used for gitlab pages):
yarn run build-doc
The compiled HTML SPA contained in src-doc
is bundled in public
folder used by gh-pages
.
Note:
WARNING: the public
folder is for gitlab-pages, do not put anything in here!
It will be destroyed before each build.
Build an exportable library - src
yarn run build-lib
npm publish
T.L.T.R.
This project is meant to be exported as a library and used into other project. The main entry is src/index.ts
file.
To achieve this and produce CJS, UMD and ESM bundles with a single declaration file... I'm doing some workaround/build step.
I'm using microbundle to produce the final dist but it does not actually compiles typescript, only strip types and this is a little bit problematic.
So there are a first compilation step:
- compile with
tsc
intobuild
folder (usingtsconfig.json
) - actually launch
microbundle
- bundle d.ts with dts-bundle-generator.
After this step the temporary build
folder can be removed.
How to improve
There is big space for improvement writing a custom rollup script that does all this by itself. See those notes:
- typescript compilation and bundle in CJS, UMD and ESM
- see this issue to bundle dts or this other rollup plugin
- see this issue to bundle css via postcss with rollup
- note: avoid temp folder is better anyway...
- see this post about ts and rollup