unplugin-tailwindcss-mangle
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "unplugin-tailwindcss-mangle", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "mangle tailwindcss utilities class plugin. support vite and webpack!", | ||
@@ -67,3 +67,3 @@ "main": "./dist/index.cjs", | ||
"@tailwindcss-mangle/config": "^1.0.1", | ||
"@tailwindcss-mangle/core": "^2.0.0", | ||
"@tailwindcss-mangle/core": "^2.0.1", | ||
"@tailwindcss-mangle/shared": "^2.0.0" | ||
@@ -70,0 +70,0 @@ }, |
@@ -11,11 +11,9 @@ # unplugin-tailwindcss-mangle | ||
- [1. Install Package](#1-install-package) | ||
- [2. Run patch script](#2-run-patch-script) | ||
- [2. Run install script](#2-run-install-script) | ||
- [3. add `prepare` script in your `package.json`](#3-add-prepare-script-in-your-packagejson) | ||
- [4. run extract command](#4-run-extract-command) | ||
- [5. register this plugin](#5-register-this-plugin) | ||
- [4. Run extract command](#4-run-extract-command) | ||
- [5. Register this plugin](#5-register-this-plugin) | ||
- [vite](#vite) | ||
- [webpack](#webpack) | ||
- [Options](#options) | ||
- [classGenerator](#classgenerator) | ||
- [include / exclude](#include--exclude) | ||
- [Notice](#notice) | ||
@@ -40,3 +38,3 @@ | ||
### 2. Run patch script | ||
### 2. Run install script | ||
@@ -55,4 +53,6 @@ ```sh | ||
### 4. run extract command | ||
### 4. Run extract command | ||
cd to the same directory as `package.son` and `tailwind.config.js`, then run: | ||
```sh | ||
@@ -64,5 +64,5 @@ npx tw-patch extract | ||
Then there will generate a json file: `.tw-patch/tw-class-list.json` | ||
Then there will generate a json file: `.tw-patch/tw-class-list.json` | ||
### 5. register this plugin | ||
### 5. Register this plugin | ||
@@ -75,3 +75,3 @@ #### vite | ||
import vue from '@vitejs/plugin-vue' | ||
import { vitePlugin as utwm } from 'unplugin-tailwindcss-mangle' | ||
import utwm from 'unplugin-tailwindcss-mangle/vite' | ||
// https://vitejs.dev/config/ | ||
@@ -100,3 +100,3 @@ export default defineConfig({ | ||
// or cjs | ||
const { webpackPlugin: utwm } = require('unplugin-tailwindcss-mangle') | ||
const utwm = require('unplugin-tailwindcss-mangle/webpack') | ||
// use this webpack plugin | ||
@@ -119,30 +119,8 @@ // for example next.config.js | ||
### classGenerator | ||
[types.ts]('./src/types.ts') | ||
custom class generator, if you want to custom class name (default 'tw-*'), use this options | ||
## Notice | ||
```js | ||
export interface IClassGeneratorOptions { | ||
reserveClassName?: (string | RegExp)[] | ||
// custom generate class name | ||
customGenerate?: (original: string, opts: IClassGeneratorOptions, context: Record<string, any>) => string | undefined | ||
log?: boolean | ||
exclude?: (string | RegExp)[] | ||
include?: (string | RegExp)[] | ||
ignoreClass?: (string | RegExp)[] | ||
// default 'tw-',for example: tw-a,tw-b, you can set any you want, like '','ice-' | ||
classPrefix?: string | ||
} | ||
``` | ||
By default, only the build will take effect. Due to some restrictions, it cannot take effect in the development mode. | ||
### include / exclude | ||
Type: `string | string[]` | ||
Default: `undefined` | ||
`glob string` allow you to control the mangle range of bundles. | ||
## Notice | ||
This plugin only transform those classes which name contain `-` or `:`, like `w-32`, `before:h-[300px]`,`after:dark:via-[#0141ff]/40`. some classes like `flex`,`relative` will not be mangled. | ||
@@ -149,0 +127,0 @@ |
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
0
42183
131
+ Added@babel/generator@7.26.5(transitive)
+ Added@babel/parser@7.26.7(transitive)
+ Added@babel/template@7.25.9(transitive)
+ Added@babel/traverse@7.26.7(transitive)
+ Added@babel/types@7.26.7(transitive)
+ Addedpathe@2.0.2(transitive)
+ Addedpostcss@8.5.1(transitive)
- Removed@babel/generator@7.26.8(transitive)
- Removed@babel/parser@7.26.8(transitive)
- Removed@babel/template@7.26.8(transitive)
- Removed@babel/traverse@7.26.8(transitive)
- Removed@babel/types@7.26.8(transitive)
- Removedpathe@2.0.3(transitive)
- Removedpostcss@8.5.2(transitive)