Skip to content

Commit a807c0b

Browse files
authored
Release: mangle plugin 2.0.0 (#37)
* chore: use new build config * chore(deps): upgrade * feat: commit new vite and webpack config * chore: no support webpack dev mode * chore: commit docs * feat: commit new plugins * feat: commit default include and exclude * feat: commit babel plugin * feat: commit addToUsedBy and dump * feat: commit snap * feat: set preflight false * chore: commit git diff * fix: desc str replace * feat: move ast plugin to core pkg * fix: pre process js test case * chore: bump config 1.0.1
1 parent a4de2ba commit a807c0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+3337
-2066
lines changed

.eslintignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
packages/unplugin-tailwindcss-mangle/test/fixtures/**/*
2-
packages/tailwindcss-patch/test/fixtures/**/*
2+
packages/tailwindcss-patch/test/fixtures/**/*
3+
packages/*/dist
4+
packages/**/fixtures

.vscode/launch.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,76 @@
44
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7+
{
8+
"command": "yarn dev",
9+
"name": "[vite-vue] dev",
10+
"request": "launch",
11+
"type": "node-terminal",
12+
"cwd": "${workspaceFolder}/apps/vite-vue"
13+
},
14+
{
15+
"command": "yarn build",
16+
"name": "[vite-vue] build",
17+
"request": "launch",
18+
"type": "node-terminal",
19+
"cwd": "${workspaceFolder}/apps/vite-vue"
20+
},
21+
{
22+
"command": "yarn dev",
23+
"name": "[vite-react] dev",
24+
"request": "launch",
25+
"type": "node-terminal",
26+
"cwd": "${workspaceFolder}/apps/vite-react"
27+
},
28+
{
29+
"command": "yarn build",
30+
"name": "[vite-react] build",
31+
"request": "launch",
32+
"type": "node-terminal",
33+
"cwd": "${workspaceFolder}/apps/vite-react"
34+
},
35+
{
36+
"command": "yarn dev",
37+
"name": "[vite-vanilla] dev",
38+
"request": "launch",
39+
"type": "node-terminal",
40+
"cwd": "${workspaceFolder}/apps/vite-vanilla"
41+
},
42+
{
43+
"command": "yarn build",
44+
"name": "[vite-vanilla] build",
45+
"request": "launch",
46+
"type": "node-terminal",
47+
"cwd": "${workspaceFolder}/apps/vite-vanilla"
48+
},
49+
{
50+
"command": "yarn dev",
51+
"name": "[webpack5-vue3] dev",
52+
"request": "launch",
53+
"type": "node-terminal",
54+
"cwd": "${workspaceFolder}/apps/webpack5-vue3"
55+
},
56+
{
57+
"command": "yarn build",
58+
"name": "[webpack5-vue3] build",
59+
"request": "launch",
60+
"type": "node-terminal",
61+
"cwd": "${workspaceFolder}/apps/webpack5-vue3"
62+
},
763
{
864
"command": "yarn patch",
965
"name": "do tailwindcss-patch",
1066
"request": "launch",
1167
"type": "node-terminal",
1268
"cwd": "${workspaceFolder}/packages/tailwindcss-patch"
1369
},
70+
{
71+
"command": "npm run dev",
72+
"name": "[next-app] dev",
73+
"request": "launch",
74+
"type": "node-terminal",
75+
"cwd": "${workspaceFolder}/apps/next-app"
76+
},
1477
{
1578
"command": "npm run test:dev",
1679
"name": "[tailwindcss-patch] test:dev",
@@ -38,6 +101,13 @@
38101
"request": "launch",
39102
"type": "node-terminal",
40103
"cwd": "${workspaceFolder}/apps/next-app"
104+
},
105+
{
106+
"command": "npm run test:dev",
107+
"name": "[core] test:dev",
108+
"request": "launch",
109+
"type": "node-terminal",
110+
"cwd": "${workspaceFolder}/packages/core"
41111
}
42112
]
43113
}

apps/next-app/next.config.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
const { webpackPlugin: utwm } = require('unplugin-tailwindcss-mangle')
1+
const utwm = require('unplugin-tailwindcss-mangle/webpack')
22
// import utwm from 'unplugin-tailwindcss-mangle'
33

44
/** @type {import('next').NextConfig} */
55
const nextConfig = {
66
reactStrictMode: true,
77
webpack: (config) => {
8-
config.plugins.push(utwm({
9-
classSetOutput: true,
10-
classMapOutput: true
11-
}))
8+
// console.log(process.env.NODE_ENV)
9+
if (process.env.NODE_ENV === 'production') {
10+
config.plugins.push(utwm({
11+
classMapOutput: true
12+
}))
13+
}
1214
return config
1315
}
1416
}

apps/next-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"prepare": "tw-patch install"
1111
},
1212
"dependencies": {
13-
"@types/node": "20.4.8",
14-
"@types/react": "18.2.18",
13+
"@types/node": "20.4.9",
14+
"@types/react": "18.2.19",
1515
"@types/react-dom": "18.2.7",
1616
"autoprefixer": "10.4.14",
1717
"eslint": "8.46.0",

apps/next-app/pages/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import Image from 'next/image'
2-
// import { Inter } from 'next/font/google'
2+
import { Inter } from 'next/font/google'
33

4-
// const inter = Inter({ subsets: ['latin'] })
4+
const inter = Inter({ subsets: ['latin'] })
55

66
export default function Home() {
7+
console.log(inter)
78
return (
89
<main className="flex min-h-screen flex-col items-center justify-between p-24">
910
<div className="z-10 w-full max-w-5xl items-center justify-between font-mono text-sm lg:flex">

apps/next-app/tailwind.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ module.exports = {
1515
},
1616
},
1717
plugins: [],
18+
corePlugins: {
19+
preflight: false
20+
}
1821
}

apps/nuxt-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"prepare": "tw-patch install"
1111
},
1212
"devDependencies": {
13-
"@types/node": "^20.4.8",
13+
"@types/node": "^20.4.9",
1414
"autoprefixer": "^10.4.14",
1515
"nuxt": "^3.6.5",
1616
"postcss": "^8.4.27",

apps/nuxt-app/tailwind.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ module.exports = {
44
theme: {
55
extend: {}
66
},
7-
plugins: []
7+
plugins: [],
8+
corePlugins: {
9+
preflight: false
10+
}
811
}

apps/remix-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"devDependencies": {
2121
"@remix-run/dev": "^1.19.2",
2222
"@remix-run/eslint-config": "^1.19.2",
23-
"@types/react": "^18.2.18",
23+
"@types/react": "^18.2.19",
2424
"@types/react-dom": "^18.2.7",
2525
"eslint": "^8.46.0",
2626
"tailwindcss": "^3.3.3",

apps/remix-app/tailwind.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ module.exports = {
44
theme: {
55
extend: {}
66
},
7-
plugins: []
7+
plugins: [],
8+
corePlugins: {
9+
preflight: false
10+
}
811
}

0 commit comments

Comments
 (0)