mirror of https://github.com/vuejs/core.git
chore: replace brotli with node:zlib (#8045)
Signed-off-by: JayFate <48240828+JayFate@users.noreply.github.com>
This commit is contained in:
parent
19e17a951c
commit
37701a88c0
|
@ -69,7 +69,6 @@
|
||||||
"@typescript-eslint/parser": "^5.56.0",
|
"@typescript-eslint/parser": "^5.56.0",
|
||||||
"@vitest/coverage-istanbul": "^0.29.7",
|
"@vitest/coverage-istanbul": "^0.29.7",
|
||||||
"@vue/consolidate": "0.17.3",
|
"@vue/consolidate": "0.17.3",
|
||||||
"brotli": "^1.3.2",
|
|
||||||
"chalk": "^4.1.0",
|
"chalk": "^4.1.0",
|
||||||
"conventional-changelog-cli": "^2.0.31",
|
"conventional-changelog-cli": "^2.0.31",
|
||||||
"enquirer": "^2.3.2",
|
"enquirer": "^2.3.2",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const { compress } = require('brotli')
|
const { brotliCompressSync } = require('zlib')
|
||||||
|
|
||||||
const file = require('fs').readFileSync('dist/index.js')
|
const file = require('fs').readFileSync('dist/index.js')
|
||||||
const compressed = compress(file)
|
const compressed = brotliCompressSync(file)
|
||||||
const compressedSize = (compressed.length / 1024).toFixed(2) + 'kb'
|
const compressedSize = (compressed.length / 1024).toFixed(2) + 'kb'
|
||||||
console.log(`brotli: ${compressedSize}`)
|
console.log(`brotli: ${compressedSize}`)
|
||||||
|
|
|
@ -18,7 +18,6 @@ importers:
|
||||||
'@typescript-eslint/parser': ^5.56.0
|
'@typescript-eslint/parser': ^5.56.0
|
||||||
'@vitest/coverage-istanbul': ^0.29.7
|
'@vitest/coverage-istanbul': ^0.29.7
|
||||||
'@vue/consolidate': 0.17.3
|
'@vue/consolidate': 0.17.3
|
||||||
brotli: ^1.3.2
|
|
||||||
chalk: ^4.1.0
|
chalk: ^4.1.0
|
||||||
conventional-changelog-cli: ^2.0.31
|
conventional-changelog-cli: ^2.0.31
|
||||||
enquirer: ^2.3.2
|
enquirer: ^2.3.2
|
||||||
|
@ -65,7 +64,6 @@ importers:
|
||||||
'@typescript-eslint/parser': 5.56.0_qesohl5arz7pvqyycxtsqomlr4
|
'@typescript-eslint/parser': 5.56.0_qesohl5arz7pvqyycxtsqomlr4
|
||||||
'@vitest/coverage-istanbul': 0.29.7_vitest@0.29.7
|
'@vitest/coverage-istanbul': 0.29.7_vitest@0.29.7
|
||||||
'@vue/consolidate': 0.17.3
|
'@vue/consolidate': 0.17.3
|
||||||
brotli: 1.3.3
|
|
||||||
chalk: 4.1.2
|
chalk: 4.1.2
|
||||||
conventional-changelog-cli: 2.2.2
|
conventional-changelog-cli: 2.2.2
|
||||||
enquirer: 2.3.6
|
enquirer: 2.3.6
|
||||||
|
@ -1467,12 +1465,6 @@ packages:
|
||||||
fill-range: 7.0.1
|
fill-range: 7.0.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/brotli/1.3.3:
|
|
||||||
resolution: {integrity: sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg==}
|
|
||||||
dependencies:
|
|
||||||
base64-js: 1.5.1
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/browserslist/4.21.5:
|
/browserslist/4.21.5:
|
||||||
resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==}
|
resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==}
|
||||||
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
|
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
|
||||||
|
|
|
@ -20,8 +20,7 @@ import fs from 'node:fs/promises'
|
||||||
import { existsSync, readFileSync, rmSync } from 'node:fs'
|
import { existsSync, readFileSync, rmSync } from 'node:fs'
|
||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
import minimist from 'minimist'
|
import minimist from 'minimist'
|
||||||
import { gzipSync } from 'node:zlib'
|
import { gzipSync, brotliCompressSync } from 'node:zlib'
|
||||||
import { compress } from 'brotli'
|
|
||||||
import chalk from 'chalk'
|
import chalk from 'chalk'
|
||||||
import execa from 'execa'
|
import execa from 'execa'
|
||||||
import { cpus } from 'node:os'
|
import { cpus } from 'node:os'
|
||||||
|
@ -143,7 +142,7 @@ function checkFileSize(filePath) {
|
||||||
const minSize = (file.length / 1024).toFixed(2) + 'kb'
|
const minSize = (file.length / 1024).toFixed(2) + 'kb'
|
||||||
const gzipped = gzipSync(file)
|
const gzipped = gzipSync(file)
|
||||||
const gzippedSize = (gzipped.length / 1024).toFixed(2) + 'kb'
|
const gzippedSize = (gzipped.length / 1024).toFixed(2) + 'kb'
|
||||||
const compressed = compress(file)
|
const compressed = brotliCompressSync(file)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const compressedSize = (compressed.length / 1024).toFixed(2) + 'kb'
|
const compressedSize = (compressed.length / 1024).toFixed(2) + 'kb'
|
||||||
console.log(
|
console.log(
|
||||||
|
|
Loading…
Reference in New Issue