Skip to content

Commit 8fad2e4

Browse files
committed
chore: update node-html-parser to work with vitest
1 parent 2e08252 commit 8fad2e4

File tree

3 files changed

+163
-52
lines changed

3 files changed

+163
-52
lines changed

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vite-plugin-html",
3-
"version": "3.2.0",
3+
"version": "3.2.0-o.3",
44
"description": "A plugin for vite to Minimize index.html and use lodash.template template syntax in index.html",
55
"main": "dist/index.cjs",
66
"module": "dist/index.mjs",
@@ -52,7 +52,7 @@
5252
"fast-glob": "^3.2.11",
5353
"fs-extra": "^10.0.1",
5454
"html-minifier-terser": "^6.1.0",
55-
"node-html-parser": "^5.3.3",
55+
"node-html-parser": "^6.1.4",
5656
"pathe": "^0.2.0"
5757
},
5858
"peerDependencies": {

packages/core/src/htmlPlugin.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { InjectOptions, PageOption, Pages, UserOptions } from './typing'
33
import { render } from 'ejs'
44
import { isDirEmpty, loadEnv } from './utils'
55
import { normalizePath } from 'vite'
6-
import parse from 'node-html-parser'
6+
import { parse } from 'node-html-parser'
77
import fs from 'fs-extra'
88
import path from 'pathe'
99
import fg from 'fast-glob'
@@ -254,7 +254,6 @@ export function removeEntryScript(html: string, verbose = false) {
254254
if (!html) {
255255
return html
256256
}
257-
258257
const root = parse(html, { comment: true })
259258
const scriptNodes = root.querySelectorAll('script[type=module]') || []
260259
const removedNode: string[] = []

0 commit comments

Comments
 (0)