Skip to content

Commit

Permalink
1.4.1 upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
bddjr committed Jan 22, 2025
1 parent 3fb60bf commit 7986373
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 66 deletions.
112 changes: 60 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,58 +37,66 @@ const router = createRouter({
## Options
See [src/options.ts](src/options.ts)
Example:
```ts
singleFileCompression({
rename: 'example.html'
}),
```

More info see [src/options.ts](src/options.ts)

```ts
export interface Options {
/**
* Rename index.html
*/
rename?: string

/**
* https://github.com/terser/html-minifier-terser?tab=readme-ov-file#options-quick-reference
* @default defaultHtmlMinifierTerserOptions
*/
htmlMinifierTerser?: htmlMinifierOptions | boolean

/**
* Try inline html used assets, if inlined or not used in JS.
* @default true
*/
tryInlineHtmlAssets?: boolean

/**
* Remove inlined asset files.
* @default true
*/
removeInlinedAssetFiles?: boolean

/**
* Try inline html icon, if icon is in public dir.
* @default true
*/
tryInlineHtmlPublicIcon?: boolean

/**
* Remove inlined html icon files.
* @default true
*/
removeInlinedPublicIconFiles?: boolean

/**
* Use Base128 to encode gzipped script.
* If false, use Base64.
* https://www.npmjs.com/package/base128-ascii
* @default true
*/
useBase128?: boolean

/**
* Compress format.
* @default "deflate-raw"
*/
compressFormat?: compressFormat
/**
* Rename index.html
*/
rename?: string;

/**
* https://github.com/terser/html-minifier-terser?tab=readme-ov-file#options-quick-reference
* @default defaultHtmlMinifierTerserOptions
*/
htmlMinifierTerser?: htmlMinifierOptions | boolean;

/**
* Try inline html used assets, if inlined or not used in JS.
* @default true
*/
tryInlineHtmlAssets?: boolean;

/**
* Remove inlined asset files.
* @default true
*/
removeInlinedAssetFiles?: boolean;

/**
* Try inline html icon, if icon is in public dir.
* @default true
*/
tryInlineHtmlPublicIcon?: boolean;

/**
* Remove inlined html icon files.
* @default true
*/
removeInlinedPublicIconFiles?: boolean;

/**
* Use Base128 to encode gzipped script.
* If false, use Base64.
* https://www.npmjs.com/package/base128-ascii
* @default true
*/
useBase128?: boolean;

/**
* Compress format.
* @default "deflate-raw"
*/
compressFormat?: compressFormat;
}
```

Expand All @@ -97,19 +105,19 @@ export interface Options {
https://bddjr.github.io/vite-plugin-singlefile-compression/

```
vite v6.0.7 building for production...
vite v6.0.11 building for production...
✓ 45 modules transformed.
rendering chunks (1)...
vite-plugin-singlefile-compression 1.4.0 building...
vite-plugin-singlefile-compression 1.4.1 building...
file:///D:/bddjr/Desktop/code/js/vite-plugin-singlefile-compression/test/dist/index.html
101.56 KiB -> 46.32 KiB
Finish.
dist/index.html 47.42 kB
built in 698ms
✓ built in 680ms
```

![](effect.jpg)
Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite-plugin-singlefile-compression",
"version": "1.4.0",
"version": "1.4.1",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
Expand Down Expand Up @@ -41,7 +41,7 @@
],
"dependencies": {
"@types/html-minifier-terser": "^7.0.2",
"@types/node": "^22.9.3",
"@types/node": "^22.10.7",
"base128-ascii": "^2.1.0",
"esbuild": "^0.24.0",
"html-minifier-terser": "^7.2.0",
Expand All @@ -50,6 +50,6 @@
"picocolors": "^1.1.1",
"rimraf": "^6.0.1",
"typescript": "^5.7.2",
"vite": "^6.0.7"
"vite": "^6.0.11"
}
}
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function setConfig(config: UserConfig) {
}

async function generateBundle(bundle: OutputBundle, config: ResolvedConfig, options: innerOptions) {
console.log(pc.reset('') + pc.cyan('\n\nvite-plugin-singlefile-compression ' + version) + pc.green(' building...'))
console.log(pc.reset('\n\n') + pc.cyan('vite-plugin-singlefile-compression ' + version) + pc.green(' building...'))

// rename
if (options.rename
Expand Down

0 comments on commit 7986373

Please sign in to comment.