![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
unplugin-tailwindcss-mangle
Advanced tools
mangle tailwindcss utilities class plugin. support vite and webpack!
mangle tailwindcss utilities plugin
Now Support
vite
andwebpack
<!-- before -->
<div class="z-10 w-full max-w-5xl items-center justify-between font-mono text-sm lg:flex"></div>
<!-- after -->
<div class="tw-g tw-h tw-i tw-d tw-e tw-j tw-k tw-l"></div>
<npm|yarn|pnpm> i -D unplugin-tailwindcss-mangle tailwindcss-patch
npx tw-patch
prepare
script in your package.json
"scripts": {
"prepare": "tw-patch"
},
// for example: vue vite project
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { vitePlugin as utwm } from 'unplugin-tailwindcss-mangle'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), utwm()]
})
then run script:
# generate bundle
yarn build
# preview
yarn preview
You will see all class was renamed to tw-*
// esm
import { webpackPlugin as utwm } from 'unplugin-tailwindcss-mangle'
// or cjs
const { webpackPlugin: utwm } = require('unplugin-tailwindcss-mangle')
// use this webpack plugin
// for example next.config.js
const { defineConfig } = require('@vue/cli-service')
// vue.config.js
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: (config) => {
config.plugins.push(utwm())
}
})
custom class generator, if you want to custom class name (default 'tw-*'), use this options
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
}
Type: string | string[]
Default: undefined
glob string
allow you to control the mangle range of bundles.
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.
because plugin will traverse all html class attr
and js StringLiteral
to find utilities
generated by tailwindcss
.
it's dangerous to mangle some js StringLiteral
like:
const innerHTML = "i'm flex and relative and grid"
document.body.innerHTML = innerHTML
so only strings with -
or :
will be transformed.
FAQs
mangle tailwindcss utilities class plugin. support vite and webpack!
The npm package unplugin-tailwindcss-mangle receives a total of 430 weekly downloads. As such, unplugin-tailwindcss-mangle popularity was classified as not popular.
We found that unplugin-tailwindcss-mangle demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.