New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

unplugin-tailwindcss-mangle

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unplugin-tailwindcss-mangle - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

4

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc