orga-build 0.3.1 → 0.3.2

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.
Files changed (2) hide show
  1. package/lib/vite.js +11 -11
  2. package/package.json +1 -1
package/lib/vite.js CHANGED
@@ -31,20 +31,20 @@ export function pluginFactory({ dir }) {
31
31
  }
32
32
  }),
33
33
 
34
- configureServer({ watcher, moduleGraph }) {
35
- const reloadVirtualModule = (/** @type {string} */ moduleId) => {
36
- const module = moduleGraph.getModuleById(moduleId)
34
+ configureServer(server) {
35
+ const { watcher, moduleGraph, ws } = server
36
+
37
+ // Invalidate content module on file changes
38
+ watcher.on('change', (filePath) => {
39
+ const module = moduleGraph.getModuleById(contentModuleIdResolved)
37
40
  if (module) {
38
41
  moduleGraph.invalidateModule(module)
39
- watcher.emit('change', moduleId)
42
+ // Send HMR update to client
43
+ ws.send({
44
+ type: 'full-reload',
45
+ path: '*'
46
+ })
40
47
  }
41
- }
42
-
43
- reloadVirtualModule('/')
44
-
45
- // Invalidate content module on file changes
46
- watcher.on('change', () => {
47
- reloadVirtualModule(contentModuleIdResolved)
48
48
  })
49
49
  },
50
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orga-build",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "A simple tool that builds org-mode files into a website",
5
5
  "type": "module",
6
6
  "bin": {