unplugin-tailwindcss-mangle 0.0.5 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -4
- package/dist/constants.d.ts +1 -0
- package/dist/esbuild.js +5 -4
- package/dist/esbuild.mjs +5 -4
- package/dist/index.js +368 -164
- package/dist/index.mjs +363 -160
- package/dist/js/index.d.ts +2 -1
- package/dist/nuxt.js +9 -33
- package/dist/nuxt.mjs +9 -33
- package/dist/options.d.ts +11 -0
- package/dist/rollup.js +5 -4
- package/dist/rollup.mjs +5 -4
- package/dist/types.d.ts +13 -1
- package/dist/utils.d.ts +5 -0
- package/dist/vite.js +5 -4
- package/dist/vite.mjs +5 -4
- package/dist/webpack.js +5 -4
- package/dist/webpack.mjs +5 -4
- package/package.json +17 -15
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
mangle tailwindcss utilities plugin
|
|
4
4
|
|
|
5
|
-
> Now Support `vite` and `webpack`
|
|
5
|
+
> Now Support `vite` and `webpack`
|
|
6
6
|
|
|
7
7
|
- [unplugin-tailwindcss-mangle](#unplugin-tailwindcss-mangle)
|
|
8
8
|
- [Features](#features)
|
|
@@ -15,6 +15,7 @@ mangle tailwindcss utilities plugin
|
|
|
15
15
|
- [webpack](#webpack)
|
|
16
16
|
- [Options](#options)
|
|
17
17
|
- [classGenerator](#classgenerator)
|
|
18
|
+
- [include / exclude](#include--exclude)
|
|
18
19
|
- [Notice](#notice)
|
|
19
20
|
|
|
20
21
|
## Features
|
|
@@ -76,15 +77,23 @@ You will see all class was renamed to `tw-*`
|
|
|
76
77
|
|
|
77
78
|
#### webpack
|
|
78
79
|
|
|
79
|
-
> Experiment, not work right now
|
|
80
|
-
|
|
81
80
|
```js
|
|
82
81
|
// esm
|
|
83
82
|
import { webpackPlugin as utwm } from 'unplugin-tailwindcss-mangle'
|
|
84
83
|
// or cjs
|
|
85
84
|
const { webpackPlugin: utwm } = require('unplugin-tailwindcss-mangle')
|
|
86
85
|
// use this webpack plugin
|
|
87
|
-
|
|
86
|
+
// for example next.config.js
|
|
87
|
+
/** @type {import('next').NextConfig} */
|
|
88
|
+
const nextConfig = {
|
|
89
|
+
reactStrictMode: true,
|
|
90
|
+
webpack: (config) => {
|
|
91
|
+
config.plugins.push(utwm())
|
|
92
|
+
return config
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
module.exports = nextConfig
|
|
88
97
|
```
|
|
89
98
|
|
|
90
99
|
## Options
|
|
@@ -105,6 +114,14 @@ export interface IClassGeneratorOptions {
|
|
|
105
114
|
}
|
|
106
115
|
```
|
|
107
116
|
|
|
117
|
+
### include / exclude
|
|
118
|
+
|
|
119
|
+
Type: `string | string[]`
|
|
120
|
+
|
|
121
|
+
Default: `undefined`
|
|
122
|
+
|
|
123
|
+
`glob string` allow you to control the mangle range of bundles.
|
|
124
|
+
|
|
108
125
|
## Notice
|
|
109
126
|
|
|
110
127
|
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.
|
package/dist/constants.d.ts
CHANGED
package/dist/esbuild.js
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index.js');
|
|
4
4
|
require('unplugin');
|
|
5
|
-
require('
|
|
5
|
+
require('micromatch');
|
|
6
|
+
require('fs');
|
|
7
|
+
require('path');
|
|
6
8
|
require('parse5');
|
|
7
|
-
require('@babel/
|
|
8
|
-
require('@babel/parser');
|
|
9
|
-
require('@babel/traverse');
|
|
9
|
+
require('@babel/core');
|
|
10
10
|
require('postcss');
|
|
11
11
|
require('postcss-selector-parser');
|
|
12
|
+
require('tailwindcss-patch');
|
|
12
13
|
|
|
13
14
|
var esbuild = index.unplugin.esbuild;
|
|
14
15
|
|
package/dist/esbuild.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { unplugin } from './index.mjs';
|
|
2
2
|
import 'unplugin';
|
|
3
|
-
import '
|
|
3
|
+
import 'micromatch';
|
|
4
|
+
import 'fs';
|
|
5
|
+
import 'path';
|
|
4
6
|
import 'parse5';
|
|
5
|
-
import '@babel/
|
|
6
|
-
import '@babel/parser';
|
|
7
|
-
import '@babel/traverse';
|
|
7
|
+
import '@babel/core';
|
|
8
8
|
import 'postcss';
|
|
9
9
|
import 'postcss-selector-parser';
|
|
10
|
+
import 'tailwindcss-patch';
|
|
10
11
|
|
|
11
12
|
var esbuild = unplugin.esbuild;
|
|
12
13
|
|