This template provides a basic structure for an Electron application using TypeScript, Tailwind CSS, and webpack.
- Electron
- TypeScript
- Tailwind CSS
- Webpack
- ESLint
- Hot Reloading
Before you begin, ensure you have the following installed:
- Node.js (LTS version recommended)
- npm (comes with Node.js)
-
Click the "Use this template" button on the GitHub page of this repository.
-
Name your new project and create the repository.
-
Clone your new repository locally:
git clone https://github.com/Acro88/electron-typescript-tailwind-webpack-template.git
-
Navigate to the project directory:
cd your-project-name
-
Install dependencies:
npm install
-
Run the application in development mode:
npm start
.
├── src/
│ ├── main/
│ │ └── index.ts # Main process
│ ├── preload/
│ │ └── preload.ts # Preload scripts
│ └── renderer/
│ ├── index.html # HTML template
│ ├── renderer.ts # Renderer process
│ └── styles.css # Styles (including Tailwind)
├── .eslintrc.json # ESLint configuration
├── .gitignore
├── forge.config.ts # Electron Forge configuration
├── package.json
├── postcss.config.js # PostCSS configuration
├── tailwind.config.js # Tailwind configuration
├── tsconfig.json # TypeScript configuration
├── webpack.main.config.ts # Webpack configuration for main process
├── webpack.plugins.ts # Webpack plugins
├── webpack.renderer.config.ts # Webpack configuration for renderer process
└── webpack.rules.ts # Webpack rules
npm start
: Runs the app in development modenpm run package
: Packages the appnpm run make
: Creates a distributable packagenpm run publish
: Publishes the appnpm run lint
: Runs ESLint
- Main process: Edit
src/main/index.ts
to add functionality to the main process. - Renderer process: Modify
src/renderer/renderer.ts
andsrc/renderer/index.html
to update the UI and renderer process functionality. - Styles: Use
src/renderer/styles.css
for custom CSS and Tailwind classes. - Electron Forge configuration: Adjust
forge.config.ts
for packaging and distribution options.