html-bundle 6.1.7 → 6.1.8

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/README.md CHANGED
@@ -12,7 +12,7 @@ A (primarily) zero-config bundler for HTML files. The idea is to use HTML as Sin
12
12
  - 📦 Automatic Package Installation
13
13
  - 💨 HMR and automatic reconnect
14
14
  - ⚡ [ESBuild](https://github.com/evanw/esbuild)
15
- - 🦔 [Critical CSS](https://www.npmjs.com/package/critters)
15
+ - 🦔 [Critical CSS](https://www.npmjs.com/package/beasties)
16
16
  - 🚋 Watcher on PostCSS and Tailwind CSS and TS Config
17
17
  - 🛡️ Almost no need to restart
18
18
 
package/dist/bundle.mjs CHANGED
@@ -7,7 +7,7 @@ import { sep } from "path";
7
7
  import { glob } from "glob";
8
8
  import postcss from "postcss";
9
9
  import esbuild from "esbuild";
10
- import Critters from "critters";
10
+ import Beasties from "beasties";
11
11
  import { minify } from "html-minifier-terser";
12
12
  import { watch } from "chokidar";
13
13
  import { serialize, parse, parseFragment } from "parse5";
@@ -16,7 +16,7 @@ import awaitSpawn from "await-spawn";
16
16
  import { fileCopy, createDefaultServer, getPostCSSConfig, getBuildPath, createDir, bundleConfig, serverSentEvents, addHMRCode, } from "./utils.mjs";
17
17
  const isHMR = process.argv.includes("--hmr") || bundleConfig.hmr;
18
18
  const isCritical = process.argv.includes("--isCritical") || bundleConfig.isCritical;
19
- const critters = new Critters({
19
+ const beasties = new Beasties({
20
20
  path: bundleConfig.build,
21
21
  logLevel: "silent",
22
22
  ...bundleConfig.critical,
@@ -336,8 +336,8 @@ async function minifyHTML(file, buildFile) {
336
336
  if (isCritical) {
337
337
  try {
338
338
  const isPartical = !fileText.startsWith("<!DOCTYPE html>");
339
- fileText = await critters.process(fileText);
340
- // fix critters jsdom
339
+ fileText = await beasties.process(fileText);
340
+ // fix beasties jsdom
341
341
  if (isPartical) {
342
342
  fileText = fileText.replace(/<\/?(html|head|body)>/g, "");
343
343
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-bundle",
3
- "version": "6.1.7",
3
+ "version": "6.1.8",
4
4
  "description": "A very simple bundler for HTML SFC",
5
5
  "bin": "./dist/bundle.mjs",
6
6
  "types": "./src/config.d.ts",
@@ -19,12 +19,12 @@
19
19
  "author": "Fabian Klingenberg <klingenberg.fabian@gmx.de> (https://klingenberg.netlify.app/)",
20
20
  "license": "MIT",
21
21
  "devDependencies": {
22
- "@types/cssnano": "^5.1.0",
22
+ "@types/cssnano": "^5.1.3",
23
23
  "@types/glob": "^8.1.0",
24
24
  "@types/html-minifier-terser": "^7.0.2",
25
25
  "@types/parse5": "^7.0.0",
26
26
  "@types/postcss-load-config": "^3.0.1",
27
- "typescript": "^5.6.2"
27
+ "typescript": "^5.6.3"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",
@@ -32,18 +32,18 @@
32
32
  },
33
33
  "bugs": "https://github.com/Krutsch/html-bundle/issues",
34
34
  "dependencies": {
35
- "@fastify/static": "^8.0.1",
35
+ "@fastify/static": "^8.0.2",
36
36
  "@web/parse5-utils": "^2.1.0",
37
37
  "await-spawn": "^4.0.2",
38
+ "beasties": "^0.1.0",
38
39
  "chokidar": "^4.0.1",
39
- "critters": "^0.0.24",
40
40
  "cssnano": "^7.0.6",
41
41
  "esbuild": "^0.24.0",
42
42
  "fastify": "^5.0.0",
43
43
  "glob": "^11.0.0",
44
44
  "html-minifier-terser": "^7.2.0",
45
- "hydro-js": "^1.5.21",
46
- "parse5": "^7.1.2",
45
+ "hydro-js": "^1.5.22",
46
+ "parse5": "^7.2.0",
47
47
  "postcss": "^8.4.47",
48
48
  "postcss-load-config": "^6.0.1"
49
49
  }
package/src/bundle.mts CHANGED
@@ -10,7 +10,7 @@ import { sep } from "path";
10
10
  import { glob } from "glob";
11
11
  import postcss from "postcss";
12
12
  import esbuild from "esbuild";
13
- import Critters from "critters";
13
+ import Beasties from "beasties";
14
14
  import { minify } from "html-minifier-terser";
15
15
  import { watch } from "chokidar";
16
16
  import { serialize, parse, parseFragment } from "parse5";
@@ -30,7 +30,7 @@ import {
30
30
  const isHMR = process.argv.includes("--hmr") || bundleConfig.hmr;
31
31
  const isCritical =
32
32
  process.argv.includes("--isCritical") || bundleConfig.isCritical;
33
- const critters = new Critters({
33
+ const beasties = new Beasties({
34
34
  path: bundleConfig.build,
35
35
  logLevel: "silent",
36
36
  ...bundleConfig.critical,
@@ -398,8 +398,8 @@ async function minifyHTML(file: string, buildFile: string) {
398
398
  if (isCritical) {
399
399
  try {
400
400
  const isPartical = !fileText.startsWith("<!DOCTYPE html>");
401
- fileText = await critters.process(fileText);
402
- // fix critters jsdom
401
+ fileText = await beasties.process(fileText);
402
+ // fix beasties jsdom
403
403
  if (isPartical) {
404
404
  fileText = fileText.replace(/<\/?(html|head|body)>/g, "");
405
405
  }
package/src/utils.mts CHANGED
@@ -1,6 +1,3 @@
1
- import type { Options as HTMLOptions } from "html-minifier-terser";
2
- import type { Options } from "critters";
3
- import type { BuildOptions } from "esbuild";
4
1
  import type { Node } from "@web/parse5-utils";
5
2
  import type { FastifyServerOptions } from "fastify";
6
3
  import { copyFile, mkdir, readFile } from "fs/promises";