@node-minify/clean-css
Advanced tools
Comparing version 8.0.6 to 9.0.0
@@ -5,3 +5,3 @@ import { MinifierOptions } from '@node-minify/types'; | ||
* node-minify | ||
* Copyright(c) 2011-2023 Rodolphe Stoclin | ||
* Copyright(c) 2011-2024 Rodolphe Stoclin | ||
* MIT Licensed | ||
@@ -11,3 +11,3 @@ */ | ||
declare const minifyCleanCSS: { | ||
({ settings, content, callback, index }: MinifierOptions): string | void; | ||
({ settings, content, callback, index, }: MinifierOptions): string | void; | ||
default: any; | ||
@@ -14,0 +14,0 @@ }; |
@@ -26,5 +26,10 @@ "use strict"; | ||
// src/index.ts | ||
var import_utils = require("@node-minify/utils"); | ||
var import_clean_css = __toESM(require("clean-css")); | ||
var import_utils = require("@node-minify/utils"); | ||
var minifyCleanCSS = ({ settings, content, callback, index }) => { | ||
var minifyCleanCSS = ({ | ||
settings, | ||
content, | ||
callback, | ||
index | ||
}) => { | ||
if (settings?.options?.sourceMap) { | ||
@@ -34,5 +39,7 @@ settings.options._sourceMap = settings.options.sourceMap; | ||
} | ||
const _cleanCSS = new import_clean_css.default(settings && { returnPromise: false, ...settings.options }).minify(content ?? ""); | ||
const _cleanCSS = new import_clean_css.default( | ||
settings && { returnPromise: false, ...settings.options } | ||
).minify(content ?? ""); | ||
const contentMinified = _cleanCSS.styles; | ||
if (_cleanCSS.sourceMap && typeof settings?.options?._sourceMap === "object") { | ||
if (_cleanCSS.sourceMap && typeof settings?.options?._sourceMap === "object" && "url" in settings.options._sourceMap) { | ||
import_utils.utils.writeFile({ | ||
@@ -45,3 +52,7 @@ file: typeof settings.options._sourceMap.url === "string" ? settings.options._sourceMap.url : "", | ||
if (settings && !settings.content && settings.output) { | ||
settings.output && import_utils.utils.writeFile({ file: settings.output, content: contentMinified, index }); | ||
settings.output && import_utils.utils.writeFile({ | ||
file: settings.output, | ||
content: contentMinified, | ||
index | ||
}); | ||
} | ||
@@ -57,5 +68,5 @@ if (callback) { | ||
* node-minify | ||
* Copyright(c) 2011-2023 Rodolphe Stoclin | ||
* Copyright(c) 2011-2024 Rodolphe Stoclin | ||
* MIT Licensed | ||
*/ | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@node-minify/clean-css", | ||
"version": "8.0.6", | ||
"version": "9.0.0", | ||
"description": "clean-css plugin for @node-minify", | ||
@@ -15,3 +15,3 @@ "keywords": [ | ||
"engines": { | ||
"node": ">=16.0.0" | ||
"node": ">=18.0.0" | ||
}, | ||
@@ -26,5 +26,7 @@ "directories": { | ||
"exports": { | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts" | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.cjs" | ||
} | ||
}, | ||
@@ -44,16 +46,18 @@ "files": [ | ||
}, | ||
"scripts": { | ||
"clean": "pnpm dlx rimraf dist", | ||
"build": "pnpm clean && tsup src/index.ts --format cjs,esm --dts --clean --sourcemap", | ||
"prepublishOnly": "pnpm build" | ||
}, | ||
"dependencies": { | ||
"@node-minify/utils": "8.0.6", | ||
"clean-css": "5.3.2" | ||
"clean-css": "5.3.3", | ||
"@node-minify/utils": "9.0.0" | ||
}, | ||
"devDependencies": { | ||
"@node-minify/types": "8.0.6", | ||
"@types/clean-css": "^4.2.6" | ||
"@types/clean-css": "^4.2.6", | ||
"@node-minify/types": "9.0.0" | ||
}, | ||
"gitHead": "9fb532af458cb6416ecfb7abfb9cc0a3b9cb42e1" | ||
} | ||
"scripts": { | ||
"clean": "pnpm dlx rimraf dist", | ||
"build": "pnpm clean && tsup src/index.ts --format cjs,esm --dts --clean --sourcemap", | ||
"lint": "biome lint .", | ||
"test": "vitest run", | ||
"test:ci": "vitest run --coverage", | ||
"test:watch": "vitest" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
15232
129
+ Added@node-minify/utils@9.0.0(transitive)
+ Addedclean-css@5.3.3(transitive)
- Removed@node-minify/utils@8.0.6(transitive)
- Removedclean-css@5.3.2(transitive)
Updated@node-minify/utils@9.0.0
Updatedclean-css@5.3.3