Hey everyone! π
I've been working with Nextron (Next.js + Electron) lately, and I noticed a frustrating gap. Most templates out there are either:
- TypeScript-only (heavy and sometimes unnecessary for quick tools).
- Outdated (still using Tailwind v3 or old PostCSS configs).
- Incomplete (requiring manual "plumbing" to get JS and Tailwind working together).
I found that the official saltyshiomix/nextron examples were either TS-focused or lacked a pre-configured Tailwind v4 setup. So, I took the base JS skeleton and manually integrated the new Tailwind CSS v4 engine.
Introducing: nextron-js-tw4-boilerplate π οΈβ¨
π₯ Why This Template?
I manually configured this to be "plug-and-play" so you can skip the setup headache:
-
Tailwind CSS v4 Engine: Pre-installed with the high-performance
@tailwindcss/postcssbridge. - Pure JavaScript: Zero TypeScript bloat. Ideal for rapid prototyping.
- Next.js 14 (Pages Router): Chosen for its rock-solid stability in the Electron renderer process.
-
Fixed Production Assets: I pre-configured unoptimized: true in renderer/next.config.js so your images and assets don't break when you build your
.exeor.dmg. π¦β
π οΈ How to Use It
You can start your new project in two ways:
- 1οΈβ£ The "One-Click" Way (Recommended)
Go to the GitHub Repo and click the green "Use this template" button. This creates a fresh repo under your account immediately! π±οΈπ₯
- 2οΈβ£ The CLI Way
# Clone the repo
git clone https://github.com/Sudhanshu-Ambastha/nextron-js-tw4-boilerplate.git
# Enter the directory
cd nextron-js-tw4-boilerplate/template
# Install & Run
npm install
npm run dev
π§ Technical Highlights
Since Nextron has a unique directory structure, Iβve handled a few critical configurations for you:
-
Scanning via
@source: Inrenderer/styles/global.css, I added the@sourcedirective so Tailwind v4 correctly scans your JSX files inside therendererfolder. -
PostCSS Bridge: Fully configured
postcss.config.jsto ensure the v4 engine talks to the Next.js build pipeline correctly.
π Open Source
This is released under the MIT License. Iβm a big fan of the Electron community and wanted to provide a modern, JS-first alternative that works out of the box.
GitHub Repository: Sudhanshu-Ambastha/nextron-js-tw4-boilerplate
What are you building with Electron? Let me know in the comments if you run into any issues or have suggestions! π
Top comments (0)