breezify
Advanced tools
Comparing version 1.0.6 to 1.1.0
{ | ||
"name": "breezify", | ||
"version": "1.0.6", | ||
"version": "1.1.0", | ||
"description": "A tool for minifying CSS class names", | ||
@@ -12,6 +12,13 @@ "author": "Gleb Gorokhov <theververy@gmail.com>", | ||
"private": false, | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"main": "lib/cjs/index.js", | ||
"module": "lib/mjs/index.js", | ||
"exports": { | ||
".": { | ||
"import": "./lib/mjs/index.js", | ||
"require": "./lib/cjs/index.js" | ||
} | ||
}, | ||
"types": "lib/mjs/index.d.ts", | ||
"bin": { | ||
"breezify": "./lib/cli.js" | ||
"breezify": "./lib/mjs/cli.js" | ||
}, | ||
@@ -24,3 +31,3 @@ "type": "module", | ||
"clean": "rm -rf ./lib", | ||
"build": "npm run clean && tsc && chmod +x ./lib/cli.js", | ||
"build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && node create-package-jsons.js && chmod +x ./lib/cjs/cli.js && chmod +x ./lib/mjs/cli.js", | ||
"lint": "eslint . --ext .ts --fix", | ||
@@ -51,3 +58,3 @@ "test": "vitest run", | ||
"astring": "^1.8.6", | ||
"chalk": "^5.3.0", | ||
"chalk": "^4.1.2", | ||
"commander": "^12.0.0", | ||
@@ -66,4 +73,4 @@ "css-tree": "^2.3.1", | ||
"devDependencies": { | ||
"@types/css-tree": "^2.3.6", | ||
"@types/csso": "^5.0.4", | ||
"@types/css-tree": "^2.3.6", | ||
"@types/html-minifier": "^4.0.5", | ||
@@ -75,2 +82,3 @@ "@types/inquirer": "^9.0.7", | ||
"@types/pretty": "^2.0.3", | ||
"@types/webpack": "^5.28.5", | ||
"@typescript-eslint/eslint-plugin": "^7.0.1", | ||
@@ -77,0 +85,0 @@ "@typescript-eslint/parser": "^7.0.1", |
@@ -7,9 +7,11 @@ <img src="./logo_light.svg#gh-light-mode-only" alt="logo" width="200" /> | ||
![NPM Version](https://img.shields.io/npm/v/breezify?logo=npm) | ||
![NPM Downloads](https://img.shields.io/npm/dw/breezify?logo=npm) | ||
![GitHub License](https://img.shields.io/github/license/glebgorokhov/breezify) | ||
![GitHub Issues](https://img.shields.io/github/issues/glebgorokhov/breezify?logo=github) | ||
![GitHub Pull Requests](https://img.shields.io/github/issues-pr/glebgorokhov/breezify?logo=github) | ||
![GitHub Sponsors](https://img.shields.io/github/sponsors/glebgorokhov) | ||
Give some fresh air to your production HTML, JS and CSS! Breezify is a library that replaces class names in your build files with shorter ones. | ||
Works with most frameworks. _Next.js is not supported yet._ | ||
Works with most frameworks. Next.js is now supported! | ||
@@ -30,2 +32,11 @@ - [Installation](#installation) | ||
## Sponsored by | ||
[![Foxie Solutions](https://avatars.githubusercontent.com/u/128540116?s=60&v=4)](https://github.com/foxie-solutions) | ||
If you like the project and want to support it, you can donate to the author: | ||
- [GitHub Sponsors](https://github.com/sponsors/glebgorokhov) | ||
- [BuyMeACoffee](https://www.buymeacoffee.com/glebgorokhov) | ||
## Installation | ||
@@ -45,2 +56,4 @@ | ||
CommonJS: | ||
```js | ||
@@ -52,2 +65,35 @@ const breezify = require('breezify'); | ||
ESM: | ||
```js | ||
import breezify from 'breezify'; | ||
breezify(options); | ||
``` | ||
### Webpack 5 Plugin (Next.js) | ||
Initialize the plugin in your `next.config.js`: | ||
```js | ||
const { BreezifyWebpack5Plugin } = require("breezify"); | ||
module.exports = { | ||
webpack: (config) => { | ||
config.plugins.push(new BreezifyWebpack5Plugin()); | ||
return config; | ||
}, | ||
} | ||
``` | ||
You can pass options to the plugin: | ||
```js | ||
new BreezifyWebpack5Plugin({ | ||
css: { | ||
prefix: "tw-", | ||
}, | ||
}); | ||
``` | ||
## Examples | ||
@@ -62,9 +108,2 @@ | ||
## Donations 👉👈 | ||
If you like the project and want to support it, you can donate to the author: | ||
- [GitHub Sponsors](https://github.com/sponsors/glebgorokhov) | ||
- [BuyMeACoffee](https://www.buymeacoffee.com/glebgorokhov) | ||
## Abstract | ||
@@ -246,4 +285,4 @@ | ||
- `extractClassesFromHtml` (boolean | undefined): Whether to extract class names from <style> tags found in HTML files. Default: `true`. | ||
- `restructure` (boolean | undefined): Whether to restructure the output CSS with CSSO for more efficient minification. Default: `true`. | ||
- `forceMediaMerge` (boolean | undefined): Whether to force merging media queries with CSSO for more efficient minification. Default: `true`. | ||
- `restructure` (boolean | undefined): Whether to restructure the output CSS with CSSO for more efficient minification. **Can break your styles!** Default: `false`. | ||
- `forceMediaMerge` (boolean | undefined): Whether to force merging media queries with CSSO for more efficient minification. **Can break your styles!** Default: `false`. | ||
@@ -270,4 +309,4 @@ ## JSOptions | ||
```javascript | ||
{ | ||
```ts | ||
const options: BreezifyOptions = { | ||
files: { | ||
@@ -279,4 +318,2 @@ buildDir: "dist", | ||
css: { | ||
sourceMap: true, | ||
shuffle: true, | ||
minify: true, | ||
@@ -288,3 +325,2 @@ extractClassesFromHtml: true, | ||
minify: true, | ||
minifyInlineJS: true, | ||
}, | ||
@@ -291,0 +327,0 @@ html: { |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
147717
89
2796
335
19
9
1
Updatedchalk@^4.1.2