chokibasic 1.0.9 → 1.0.11

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/package.json +2 -2
  2. package/src/watcher.js +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chokibasic",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Basic chokidar watcher + pxpros + esbuild + sass + csso helpers",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "esbuild",
24
24
  "csso"
25
25
  ],
26
- "author": "",
26
+ "author": "Maxime Larrivée-Roy",
27
27
  "license": "MIT",
28
28
  "type": "commonjs",
29
29
  "bugs": {
package/src/watcher.js CHANGED
@@ -368,7 +368,9 @@ async function walkAndCopy(dir, src, dest, ig, stats, banner = null) {
368
368
  const lower = abs.toLowerCase();
369
369
  if (lower.endsWith('.js')) await fsprom.writeFile(copied, "/*!\n\n" + bannerContent + "\n\n*/\n" + (await fsprom.readFile(copied, 'utf8')), "utf8");
370
370
  else if (lower.endsWith('.css')) await fsprom.writeFile(copied, "/*!\n\n" + bannerContent + "\n\n*/\n" + (await fsprom.readFile(copied, 'utf8')), "utf8");
371
- else if (lower.endsWith('.html')) await fsprom.writeFile(copied, "<!--\n\n" + bannerContent + "\n\n\-->\n" + (await fsprom.readFile(copied, 'utf8')).replaceAll(/###YEAR###/g, (new Date).getFullYear()), "utf8");
371
+ else if (lower.endsWith('.html')) await fsprom.writeFile(copied, "<!--\n\n" + bannerContent + "\n\n\-->\n" + (await fsprom.readFile(copied, 'utf8'))
372
+ .replaceAll(/###YEAR###/g, (new Date).getFullYear())
373
+ .replaceAll(/###TIMESTAMP###/g, Math.floor(Date.now() / 1000)), "utf8");
372
374
  stats.copied++;
373
375
  }
374
376
  else stats.skipped++;