@zenithbuild/core 0.4.5 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/commands/dev.ts +6 -5
- package/dist/cli.js +2 -0
- package/dist/zen-build.js +6937 -3488
- package/dist/zen-dev.js +6937 -3488
- package/dist/zen-preview.js +6937 -3488
- package/dist/zenith.js +6937 -3488
- package/package.json +1 -1
package/cli/commands/dev.ts
CHANGED
|
@@ -143,18 +143,19 @@ export async function dev(options: DevOptions = {}): Promise<void> {
|
|
|
143
143
|
|
|
144
144
|
if (filename.endsWith('.zen')) {
|
|
145
145
|
logger.hmr('Page', filename)
|
|
146
|
+
|
|
147
|
+
// Clear page cache to force fresh compilation on next request
|
|
148
|
+
pageCache.clear()
|
|
149
|
+
|
|
146
150
|
// Recompile CSS for new Tailwind classes in .zen files
|
|
147
151
|
if (globalsCssPath) {
|
|
148
152
|
const cssResult = await compileCssAsync({ input: globalsCssPath, output: ':memory:' })
|
|
149
153
|
if (cssResult.success) {
|
|
150
154
|
compiledCss = cssResult.css
|
|
151
|
-
// Notify clients of CSS update
|
|
152
|
-
for (const client of clients) {
|
|
153
|
-
client.send(JSON.stringify({ type: 'style-update', url: '/assets/styles.css' }))
|
|
154
|
-
}
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
|
|
157
|
+
|
|
158
|
+
// Broadcast page reload AFTER cache cleared and CSS ready
|
|
158
159
|
for (const client of clients) {
|
|
159
160
|
client.send(JSON.stringify({ type: 'reload' }))
|
|
160
161
|
}
|