https://github.com/ekv88/nbs-root
Minimal, project-agnostic tooling package built around React, Tailwind and Webpack.
https://github.com/ekv88/nbs-root
javascript ractjs tailwind tooling webpack
Last synced: 29 days ago
JSON representation
Minimal, project-agnostic tooling package built around React, Tailwind and Webpack.
- Host: GitHub
- URL: https://github.com/ekv88/nbs-root
- Owner: ekv88
- License: apache-2.0
- Created: 2026-01-19T12:51:44.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2026-03-20T00:41:13.000Z (3 months ago)
- Last Synced: 2026-03-20T13:38:58.543Z (3 months ago)
- Topics: javascript, ractjs, tailwind, tooling, webpack
- Language: JavaScript
- Homepage:
- Size: 1.98 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nbs-root
[](https://www.npmjs.com/package/@ekv88/nbs-root)
[](https://www.npmjs.com/package/@ekv88/nbs-root)
[](https://github.com/ekv88/nbs-root/actions/workflows/ci.yml)
[](https://react.dev/)
[](https://webpack.js.org/)
[](https://tailwindcss.com/)
Minimal, project-agnostic tooling package built around Tailwind and Webpack. Drop it into a React project and get profile-based dev/build scripts, hydrated SSG, and AI-ready page context without rebuilding your tooling stack from scratch.

## โจ Why Developers Pick It
- ๐ One package gives you dev server, production builds, SSG, and AI output
- ๐งฉ Package-owned defaults keep projects clean and override-friendly
- โก React hydration, code splitting, and standard SPA patterns work out of the box
- ๐ง AI-readable Markdown output helps with SEO, AEO, content workflows, and agent ingestion
- ๐ ๏ธ Route-aware static export works without turning the whole project into a framework migration
## ๐ Feature Snapshot
| Experience | What You Get | Command |
| --- | --- | --- |
| `SPA` | Dev server and production client bundle | `nbs-root dev:development` / `nbs-root build:production` |
| `SSG` | Static HTML output with client hydration | `nbs-root build-ssg:production` |
| `AI Optimized SEO / AEO` | AI-readable Markdown with page text, headings, metadata, and rendered markup | `nbs-root build-ai:production` |
## ๐ฅ Built For Real Projects
| Capability | Included |
| --- | --- |
| Hydration with `hydrateRoot` fallback | โ
|
| Standard SPA flow | โ
|
| Route-aware SSG | โ
|
| AI-ready site context generation | โ
|
| Webpack code splitting | โ
|
| Tailwind-ready CSS pipeline | โ
|
| Babel + ESLint + PostCSS defaults | โ
|
| Project-level overrides when needed | โ
|
## ๐ฆ Install
For an existing React project:
```bash
npm i @ekv88/nbs-root
```
## ๐ Quick Start
Minimal project shape:
```text
my-site/
.env-cmdrc
src/
App.js
index.css
assets/
```
Example scripts:
```json
{
"scripts": {
"start": "nbs-root dev:development",
"build:prod": "nbs-root build:production",
"build:staging": "nbs-root build:staging",
"build-ssg:prod": "nbs-root build-ssg:production",
"build-ai:prod": "nbs-root build-ai:production",
"lint": "nbs-root lint"
}
}
```
By default, the only required project-level config is `.env-cmdrc`. The package provides defaults for Babel, ESLint, PostCSS, a Tailwind-ready CSS pipeline, the HTML template, and the runtime entry. If a project adds its own config or bootstrap files, those override the defaults.
## ๐งญ Output Modes
### SPA build
- Produces the client app in `dist/`
- Emits JS to `dist/js/` and CSS to `dist/css/`
- Keeps `index.html`, `asset-manifest.json`, and copied assets at the `dist/` root
### SSG build
- Pre-renders static HTML
- Reuses the client bundle for hydration
- Supports multi-route output through `src/App.ssg.js`
### AI build
- Writes AI-readable Markdown into `dist/ai/`
- Includes visible text, headings, metadata, and markup snapshots
- Useful for AI SEO / AEO workflows and downstream tooling
## ๐ ๏ธ Override Only What You Need
- `src/index.js` or `src/index.jsx`
- `src/index.ejs`
- `src/App.ssg.js` or `src/App.static.js` or `src/App.server.js`
- `babel.config.*`
- `eslint.config.*`
- `postcss.config.*`
- `tailwind.config.*`
Env-based path overrides are also available, including `NBS_PROJECT_ROOT`, `NBS_APP_MODULE`, `NBS_STATIC_APP_MODULE`, `NBS_HTML_TEMPLATE`, and `NBS_OUTPUT_DIR`.
## ๐ Route-Aware SSG
If a project wants multi-route static export, it can provide `src/App.ssg.js` and export:
```js
export function createStaticApp(route) {
return ;
}
export function getStaticRoutes() {
return ["/", "/about", "/guides/ssg"];
}
```
If no static module is present, `nbs-root` falls back to the normal app module and renders a single root page.
## ๐งช Repo Development
This repo contains the package plus a local test project used to verify it before publishing.
- `npm run dev:test`
- `npm run build:test:prod`
- `npm run build:test:staging`
- `npm run build-ssg:test:prod`
- `npm run build-ai:test:prod`
- `npm run lint:test`
- `npm run pack:root`
## ๐ Links
- npm: https://www.npmjs.com/package/@ekv88/nbs-root
- GitHub: https://github.com/ekv88/nbs-root
- Package-focused docs: [`packages/nbs-root/README.md`](packages/nbs-root/README.md)