rollup-plugin-gzip
Advanced tools
Comparing version 3.1.2 to 4.0.0
@@ -1,3 +0,1 @@ | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { ZlibOptions } from 'zlib'; | ||
@@ -4,0 +2,0 @@ import { Plugin } from 'rollup'; |
@@ -1,11 +0,9 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const fs = require("fs"); | ||
const path_1 = require("path"); | ||
const util_1 = require("util"); | ||
const zlib_1 = require("zlib"); | ||
const rollup_1 = require("rollup"); | ||
const readFile = (0, util_1.promisify)(fs.readFile); | ||
const writeFile = (0, util_1.promisify)(fs.writeFile); | ||
const gzipPromise = (0, util_1.promisify)(zlib_1.gzip); | ||
import * as fs from 'fs'; | ||
import { basename, dirname, join } from 'path'; | ||
import { promisify } from 'util'; | ||
import { gzip } from 'zlib'; | ||
import { VERSION, } from 'rollup'; | ||
const readFile = promisify(fs.readFile); | ||
const writeFile = promisify(fs.writeFile); | ||
const gzipPromise = promisify(gzip); | ||
const isFunction = (arg) => typeof arg === 'function'; | ||
@@ -36,3 +34,3 @@ const isRegExp = (arg) => Object.prototype.toString.call(arg) === '[object RegExp]'; | ||
? outputFile.map.toUrl() | ||
: `${(0, path_1.basename)(outputFileName)}.map`; | ||
: `${basename(outputFileName)}.map`; | ||
// https://github.com/rollup/rollup/blob/master/src/utils/sourceMappingURL.ts#L1 | ||
@@ -56,3 +54,3 @@ const sourceMapComment = `//# source` + `MappingURL=${url}\n`; | ||
function performInitChecks(options) { | ||
if (rollup_1.VERSION < '2.0.0') { | ||
if (VERSION < '2.0.0') { | ||
console.error('[rollup-plugin-gzip] This plugin supports rollup version >= 2.0.0!'); | ||
@@ -96,3 +94,3 @@ console.error('For older rollup versions, please use an older version of this plugin.'); | ||
const outputDir = outputOptions.file | ||
? (0, path_1.dirname)(outputOptions.file) | ||
? dirname(outputOptions.file) | ||
: outputOptions.dir || ''; | ||
@@ -115,3 +113,3 @@ const compressBundleFile = async (fileName) => { | ||
try { | ||
await writeFile((0, path_1.join)(outputDir, mapFileName(fileName)), await options.customCompression(fileContent)); | ||
await writeFile(join(outputDir, mapFileName(fileName)), await options.customCompression(fileContent)); | ||
} | ||
@@ -155,2 +153,2 @@ catch (error) { | ||
} | ||
exports.default = gzipPlugin; | ||
export default gzipPlugin; |
{ | ||
"name": "rollup-plugin-gzip", | ||
"version": "3.1.2", | ||
"version": "4.0.0", | ||
"engines": { | ||
@@ -18,8 +18,8 @@ "node": ">=10.0.0" | ||
], | ||
"type": "commonjs", | ||
"main": "./dist/index.js", | ||
"module": "./dist-es/index.mjs", | ||
"type": "module", | ||
"main": "./dist/cjs/index.cjs", | ||
"module": "./dist/index.mjs", | ||
"exports": { | ||
"require": "./dist/index.js", | ||
"import": "./dist-es/index.mjs", | ||
"require": "./dist/cjs/index.cjs", | ||
"import": "./dist/index.js", | ||
"default": "./dist/index.js" | ||
@@ -29,4 +29,4 @@ }, | ||
"scripts": { | ||
"build": "tsc && tsc --project tsconfig-es.json && node rename-dist-es.js", | ||
"clean": "rimraf dist dist-es", | ||
"build": "tsc && tsc --project tsconfig-cjs.json && node rename-dist-cjs.js", | ||
"clean": "rimraf dist", | ||
"format": "prettier --write --config .prettierrc '*.js', './src/**' './test/**' './examples/**'", | ||
@@ -49,15 +49,15 @@ "lint": "eslint --ext .js,.ts .", | ||
"devDependencies": { | ||
"@types/node": "^20.11.28", | ||
"@typescript-eslint/eslint-plugin": "^7.2.0", | ||
"@typescript-eslint/parser": "^7.2.0", | ||
"@types/node": "^20.14.11", | ||
"@typescript-eslint/eslint-plugin": "^7.16.1", | ||
"@typescript-eslint/parser": "^7.16.1", | ||
"eslint": "^8.57.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-jest": "^27.9.0", | ||
"eslint-plugin-jest": "^28.6.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"prettier": "^3.2.5", | ||
"rimraf": "^5.0.5", | ||
"rollup": "^4.13.0", | ||
"typescript": "^5.4.2", | ||
"vite": "^5.1.6", | ||
"prettier": "^3.3.3", | ||
"rimraf": "^6.0.1", | ||
"rollup": "^4.19.0", | ||
"typescript": "^5.5.3", | ||
"vite": "^5.3.4", | ||
"vitest": "^1.4.0" | ||
@@ -68,3 +68,3 @@ }, | ||
}, | ||
"packageManager": "yarn@4.0.2" | ||
"packageManager": "yarn@4.3.1" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Yes
23560
347
1