Skip to content

Commit 8762931

Browse files
index.html
1 parent 373feed commit 8762931

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,32 @@ With **CDN-hosted** resources, MiniTemplate is designed for **pagespeed optimiza
143143

144144
There’s no need for local tools like Node.js. MiniTemplate runs entirely on CDN resources, making it the **simplest static site generator** for building quick and efficient websites.
145145

146+
## Production Optimization
147+
148+
To further optimize your MiniTemplate project for production, you can follow these simple steps to ensure minimal file sizes and faster page load times without using any npm or local dependencies:
149+
150+
1. **Use PurgeCSS via CDN**: PurgeCSS can help remove any unused CSS classes from Tailwind and DaisyUI, reducing the final CSS file size significantly.
151+
- Add this `<script>` tag to your HTML:
152+
```html
153+
<script src="https://unpkg.com/purgecss@2.1.0/lib/browser.js"></script>
154+
```
155+
- PurgeCSS will automatically analyze your HTML for used CSS classes and purge unused ones on the fly.
156+
157+
2. **Enable Tailwind CSS JIT Mode**: When loading Tailwind via CDN, use the Just-In-Time (JIT) mode to keep your styles optimized during development.
158+
- Use this `<script>` tag in your HTML:
159+
```html
160+
<script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"></script>
161+
<script>
162+
tailwind.config = {
163+
mode: 'jit',
164+
purge: ['./**/*.html'],
165+
}
166+
</script>
167+
```
168+
- This helps ensure only the required classes are included.
169+
170+
By using PurgeCSS and enabling Tailwind JIT mode directly from the CDN, you can significantly reduce your CSS file size and boost your site's performance without needing any additional tools or setups.
171+
146172
## Contribute
147173

148174
We welcome contributions from the community! If you’d like to contribute, please check the [CONTRIBUTING.md](./CONTRIBUTING.md) file for details on how to get started.

0 commit comments

Comments
 (0)