@@ -7,34 +7,34 @@ const path = require("node:path")
7
7
const fs = require ( "node:fs/promises" )
8
8
const rss = require ( "@11ty/eleventy-plugin-rss" )
9
9
const dedent = require ( "dedent" )
10
- const { build } = require ( "esbuild" ) ;
10
+ const { build } = require ( "esbuild" )
11
11
12
12
const buildJS = ( config = { } ) => {
13
13
return build ( {
14
14
minify : process . NODE_ENV === "development" ? false : true ,
15
15
bundle : true ,
16
16
write : true ,
17
- outdir : ' _site/script' ,
17
+ outdir : " _site/script" ,
18
18
...config ,
19
- } ) ;
19
+ } )
20
20
}
21
21
22
22
module . exports = ( eleventyConfig ) => {
23
23
eleventyConfig . addPlugin ( rss )
24
24
eleventyConfig . addPlugin ( css )
25
-
25
+
26
26
const entryPoints = glob . sync ( "script/*.[tj]s" )
27
27
eleventyConfig . addWatchTarget ( "script/*.[tj]s" )
28
28
29
- buildJS ( { entryPoints} )
30
-
29
+ buildJS ( { entryPoints } )
30
+
31
31
eleventyConfig . on ( "beforeWatch" , ( changedFiles ) => {
32
32
// Run me before --watch or --serve re-runs
33
- if ( entryPoints . some ( watchPath => changedFiles . includes ( watchPath ) ) ) {
34
- buildJS ( { entryPoints} )
33
+ if ( entryPoints . some ( ( watchPath ) => changedFiles . includes ( watchPath ) ) ) {
34
+ buildJS ( { entryPoints } )
35
35
}
36
- } ) ;
37
-
36
+ } )
37
+
38
38
// eleventyConfig.addPlugin(js, {
39
39
// entryPoints: glob.sync("script/*.[tj]s"),
40
40
// outDir: "_site/script",
0 commit comments