rollup-plugin-gzip
Advanced tools
Comparing version 2.5.0 to 2.5.1
# Changelog | ||
## v2.5.1 (2021-11-13) | ||
- Fail build when detecting incompatible Vite bundle | ||
## v2.5.0 (2020-05-06) | ||
@@ -4,0 +8,0 @@ |
@@ -8,8 +8,10 @@ "use strict"; | ||
var rollup_1 = require("rollup"); | ||
var isFunction = function (arg) { return typeof arg === 'function'; }; | ||
var isFunction = function (arg) { | ||
return typeof arg === 'function'; | ||
}; | ||
var isRegExp = function (arg) { | ||
return Object.prototype.toString.call(arg) === '[object RegExp]'; | ||
}; | ||
var readFilePromise = util_1.promisify(fs_1.readFile); | ||
var writeFilePromise = util_1.promisify(fs_1.writeFile); | ||
var readFilePromise = (0, util_1.promisify)(fs_1.readFile); | ||
var writeFilePromise = (0, util_1.promisify)(fs_1.writeFile); | ||
// functionality partially copied from rollup | ||
@@ -36,3 +38,3 @@ /** | ||
? outputFile.map.toUrl() | ||
: path_1.basename(outputFileName) + ".map"; | ||
: (0, path_1.basename)(outputFileName) + ".map"; | ||
// https://github.com/rollup/rollup/blob/master/src/utils/sourceMappingURL.ts#L1 | ||
@@ -76,3 +78,3 @@ source += "//# source" + ("MappingURL=" + url + "\n"); | ||
return new Promise(function (resolve, reject) { | ||
zlib_1.gzip(fileContent, options.gzipOptions || {}, function (err, result) { | ||
(0, zlib_1.gzip)(fileContent, options.gzipOptions || {}, function (err, result) { | ||
if (err) { | ||
@@ -110,2 +112,8 @@ reject(err); | ||
var fileContent = getOutputFileContent(fileName, fileEntry, outputOptions); | ||
// Vite incompatibility check | ||
if (fileName.endsWith('.js') && | ||
fileContent.toString().includes('__VITE_PRELOAD__')) { | ||
return Promise.reject('[rollup-plugin-gzip] This version of rollup-plugin-gzip is not fully compatible with Vite.' + | ||
' Please upgrade to version 3.x'); | ||
} | ||
// minSize option check | ||
@@ -120,3 +128,4 @@ if (options.minSize && | ||
if (rollup_1.VERSION < '1.0.0') { | ||
bundle[compressedFileName] = compressedContent; | ||
bundle[compressedFileName] = | ||
compressedContent; | ||
} | ||
@@ -126,2 +135,3 @@ else { | ||
type: 'asset', | ||
name: compressedFileName, | ||
fileName: compressedFileName, | ||
@@ -128,0 +138,0 @@ isAsset: true, |
{ | ||
"name": "rollup-plugin-gzip", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"description": "Compress your Rollup bundle with Gzip", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"test": "jest --runInBand", | ||
"prepare": "npm run clean && npm run build && npm run format && npm run lint && npm run test" | ||
"prepare": "npm run clean && npm run build && npm run lint && npm run test" | ||
}, | ||
@@ -42,19 +42,20 @@ "repository": { | ||
"devDependencies": { | ||
"@types/jest": "^25.2.1", | ||
"@types/node": "^13.13.5", | ||
"@types/rimraf": "^3.0.0", | ||
"@typescript-eslint/eslint-plugin": "^2.31.0", | ||
"@typescript-eslint/parser": "^2.31.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-import": "^2.20.2", | ||
"eslint-plugin-jest": "^23.9.0", | ||
"@types/jest": "^27.0.2", | ||
"@types/node": "^16.11.4", | ||
"@types/rimraf": "^3.0.2", | ||
"@typescript-eslint/eslint-plugin": "^5.1.0", | ||
"@typescript-eslint/parser": "^5.1.0", | ||
"eslint": "^8.1.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-import": "^2.25.2", | ||
"eslint-plugin-jest": "^25.2.2", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"jest": "^26.0.1", | ||
"prettier": "^2.0.5", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"jest": "^27.3.1", | ||
"prettier": "^2.4.1", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.8.0", | ||
"ts-jest": "^25.4.0", | ||
"typescript": "^3.8.3" | ||
"rollup": "^2.58.0", | ||
"ts-jest": "^27.0.7", | ||
"typescript": "^4.4.4", | ||
"vite": "^2.6.14" | ||
}, | ||
@@ -61,0 +62,0 @@ "peerDependencies": { |
# rollup-plugin-gzip | ||
![ci status](https://github.com/kryops/rollup-plugin-gzip/workflows/CI/badge.svg) | ||
Creates a compressed `.gz` artifact for your Rollup bundle. | ||
@@ -4,0 +6,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27695
401
174
18