@tenjuu99/blog 0.2.31 → 0.2.32
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/lib/applyTemplate.js +6 -2
- package/lib/files.js +4 -7
- package/package.json +1 -1
package/lib/applyTemplate.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import applyCss from './cssGenerator.js'
|
|
3
3
|
import includeFilter from './includeFilter.js'
|
|
4
4
|
import { watch } from './dir.js'
|
|
5
|
-
import { staticFile, staticFiles, warmUp } from './files.js'
|
|
5
|
+
import { staticFile, staticFiles, warmUp, reload } from './files.js'
|
|
6
6
|
import { watchers } from './watcher.js'
|
|
7
7
|
|
|
8
8
|
let templates = {}
|
|
@@ -28,7 +28,11 @@ const warmUpTemplate = async () => {
|
|
|
28
28
|
|
|
29
29
|
watchers.push({
|
|
30
30
|
paths: [watch.cssDir, watch.templateDir],
|
|
31
|
-
callback: () => {
|
|
31
|
+
callback: async () => {
|
|
32
|
+
templates = {}
|
|
33
|
+
await reload()
|
|
34
|
+
await warmUpTemplate()
|
|
35
|
+
}
|
|
32
36
|
})
|
|
33
37
|
|
|
34
38
|
export { applyTemplate, warmUpTemplate }
|
package/lib/files.js
CHANGED
|
@@ -32,12 +32,9 @@ const staticFile = (name) => {
|
|
|
32
32
|
const staticFiles = () => {
|
|
33
33
|
return Object.entries(staticFilesContainer)
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
paths: [watch.cssDir, watch.templateDir],
|
|
37
|
-
callback: async () => {
|
|
35
|
+
const reload = async () => {
|
|
38
36
|
loaded = false
|
|
39
|
-
await warmUp()
|
|
40
|
-
|
|
41
|
-
})
|
|
37
|
+
return await warmUp()
|
|
38
|
+
}
|
|
42
39
|
|
|
43
|
-
export { staticFile, staticFiles, warmUp }
|
|
40
|
+
export { staticFile, staticFiles, warmUp, reload }
|