Skip to content

Commit

Permalink
fix: disable collapseInlineTagWhitespace for html minifier
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jul 31, 2021
1 parent 8845810 commit 34f3c02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/node/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function build(cliOptions: Partial<ViteSSGOptions> = {}) {
script = 'sync',
mock = false,
entry = await detectEntry(root),
formatting = null,
formatting = 'none',
crittersOptions = {},
includedRoutes = DefaultIncludedRoutes,
onBeforePageRender,
Expand Down Expand Up @@ -184,7 +184,7 @@ function format(html: string, formatting: ViteSSGOptions['formatting']) {
return require('html-minifier').minify(html, {
collapseWhitespace: true,
caseSensitive: true,
collapseInlineTagWhitespace: true,
collapseInlineTagWhitespace: false,
minifyJS: true,
minifyCSS: true,
})
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export interface ViteSSGOptions {
/**
* Applying formatter to the generated index file.
*
* @default null
* @default 'none'
*/
formatting?: null | 'minify' | 'prettify'
formatting?: 'minify' | 'prettify' | 'none'

/**
* Vite enviroument mode
Expand Down

0 comments on commit 34f3c02

Please sign in to comment.