Skip to content

Commit

Permalink
Fix helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardocavazza committed Mar 7, 2024
1 parent b67fc16 commit 4982505
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion packages/esbuild-plugin-html/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,14 @@ export default function ({ scriptsTarget = 'es2015', modulesTarget = 'es2020', m
if (minify) {
await import('htmlnano')
.then(async ({ default: htmlnano }) => {
resultHtml = (await htmlnano.process(resultHtml, minifyOptions)).html;
resultHtml = (
await htmlnano.process(resultHtml, {
minifyJs: false,
minifyCss: false,
minifyJson: false,
...minifyOptions,
})
).html;
})
.catch(() => {
warnings.push({
Expand Down
2 changes: 1 addition & 1 deletion packages/esbuild-plugin-html/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { isAbsolute } from 'path';
* @param {string | null | undefined} url The source to check.
*/
export function isRelativeUrl(url) {
if (url == null) {
if (!url) {
return false;
}
if (isAbsolute(url)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/esbuild-plugin-meta-url/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function isUrl(url) {
* @param {string} source
*/
export function getHashParam(source) {
return new URL(source).searchParams.get('hash') || null;
return new URLSearchParams(source.split('?').slice(1).join('?')).get('hash') || null;
}

/**
Expand Down

0 comments on commit 4982505

Please sign in to comment.