From b4019f3517e4a3284df51567d29938cb12bf3acc Mon Sep 17 00:00:00 2001 From: Alexander Fuks Date: Sat, 30 Nov 2024 23:07:53 +0300 Subject: [PATCH 1/3] fix: ensure pageviews are fetched after DOM is loaded (#2071) --- _includes/pageviews/goatcounter.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/_includes/pageviews/goatcounter.html b/_includes/pageviews/goatcounter.html index e62fd69..20719b4 100644 --- a/_includes/pageviews/goatcounter.html +++ b/_includes/pageviews/goatcounter.html @@ -1,12 +1,13 @@ From 8e55e4dcb25b02c667105deea7932ed344a0db6c Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sun, 1 Dec 2024 04:20:47 +0800 Subject: [PATCH 2/3] build: correct the js rollup watch path (#2074) 1. Correct the rollup watch path 2. Avoid registering watch listeners redundantly across multiple tasks --- rollup.config.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 3a1ae29..0e8a6c7 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -11,11 +11,11 @@ const DIST = 'assets/js/dist'; const banner = `/*! * ${pkg.name} v${pkg.version} | © ${pkg.since} ${pkg.author} | ${pkg.license} Licensed | ${pkg.homepage} */`; - const frontmatter = `---\npermalink: /:basename\n---\n`; - const isProd = process.env.BUILD === 'production'; +let hasWatched = false; + function cleanup() { fs.rmSync(DIST, { recursive: true, force: true }); console.log(`> Directory "${DIST}" has been cleaned.`); @@ -39,6 +39,11 @@ function build( { src = SRC_DEFAULT, jekyll = false, outputName = null } = {} ) { const input = `${src}/${filename}.js`; + const shouldWatch = hasWatched ? false : true; + + if (!hasWatched) { + hasWatched = true; + } return { input, @@ -49,9 +54,7 @@ function build( banner, sourcemap: !isProd && !jekyll }, - watch: { - include: input - }, + ...(shouldWatch && { watch: { include: `${SRC_DEFAULT}/**/*.js` } }), plugins: [ babel({ babelHelpers: 'bundled', From a16aa7d41e3c3cb28649bfa1361e8bcb91b9ca47 Mon Sep 17 00:00:00 2001 From: Alexander Fuks Date: Sat, 30 Nov 2024 23:34:12 +0300 Subject: [PATCH 3/3] fix: correct the import condition for theme script (#2075) --- _includes/head.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/_includes/head.html b/_includes/head.html index 011187c..4514666 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -99,9 +99,7 @@ - {% unless site.theme_mode %} - - {% endunless %} + {% include js-selector.html lang=lang %}