File tree Expand file tree Collapse file tree 9 files changed +62
-50
lines changed
packages/tailwindcss-patch Expand file tree Collapse file tree 9 files changed +62
-50
lines changed Original file line number Diff line number Diff line change @@ -18,16 +18,12 @@ function App() {
18
18
</ div >
19
19
< h1 > Vite + React</ h1 >
20
20
< div className = "card" >
21
- < button onClick = { ( ) => setCount ( ( count ) => count + 1 ) } >
22
- count is { count }
23
- </ button >
21
+ < button onClick = { ( ) => setCount ( ( count ) => count + 1 ) } > count is { count } </ button >
24
22
< p >
25
23
Edit < code > src/App.tsx</ code > and save to test HMR
26
24
</ p >
27
25
</ div >
28
- < p className = "read-the-docs" >
29
- Click on the Vite and React logos to learn more
30
- </ p >
26
+ < p className = "read-the-docs" > Click on the Vite and React logos to learn more</ p >
31
27
</ div >
32
28
)
33
29
}
Original file line number Diff line number Diff line change @@ -6,5 +6,5 @@ import './index.css'
6
6
ReactDOM . createRoot ( document . getElementById ( 'root' ) as HTMLElement ) . render (
7
7
< React . StrictMode >
8
8
< App />
9
- </ React . StrictMode > ,
9
+ </ React . StrictMode >
10
10
)
Original file line number Diff line number Diff line change @@ -3,5 +3,5 @@ import react from '@vitejs/plugin-react'
3
3
4
4
// https://vitejs.dev/config/
5
5
export default defineConfig ( {
6
- plugins : [ react ( ) ] ,
6
+ plugins : [ react ( ) ]
7
7
} )
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import './app.css'
2
2
import App from './App.svelte'
3
3
4
4
const app = new App ( {
5
- target : document . getElementById ( 'app' ) ,
5
+ target : document . getElementById ( 'app' )
6
6
} )
7
7
8
8
export default app
Original file line number Diff line number Diff line change @@ -3,5 +3,5 @@ import { svelte } from '@sveltejs/vite-plugin-svelte'
3
3
4
4
// https://vitejs.dev/config/
5
5
export default defineConfig ( {
6
- plugins : [ svelte ( ) ] ,
6
+ plugins : [ svelte ( ) ]
7
7
} )
Original file line number Diff line number Diff line change 30
30
"rollup" : " ^3.20.2" ,
31
31
"ts-jest" : " ^29.1.0" ,
32
32
"ts-node" : " ^10.9.1" ,
33
- "turbo" : " ^1.8.8 " ,
33
+ "turbo" : " ^1.9.0 " ,
34
34
"typescript" : " ^5.0.4"
35
35
},
36
36
"engines" : {
Original file line number Diff line number Diff line change @@ -22,19 +22,27 @@ npx tw-patch
22
22
23
23
``` json
24
24
{
25
- /* ... */
26
- "scripts" : {
27
- "prepare" : " tw-patch"
28
- }
25
+ /* ... */
26
+ "scripts" : {
27
+ "prepare" : " tw-patch"
28
+ }
29
29
}
30
30
```
31
31
32
32
## Usage
33
33
34
34
``` js
35
- import { getContexts , getClassCacheSet } from ' tailwindcss-patch'
35
+ import { getContexts , getClassCacheSet } from ' tailwindcss-patch'
36
36
// get all contexts at runtime
37
- getContexts ()
37
+ getContexts ()
38
38
// get all class generated by tailwindcss utilities
39
39
getClassCacheSet ()
40
40
```
41
+
42
+ ## Notice
43
+
44
+ ` getContexts ` ,` getClassCacheSet ` should be invoked after ` postcss-loader ` 's activation.
45
+
46
+ which means you may not get tailwindcss contexts at build start time.
47
+
48
+ you may call them at ` generateBundle ` lifetime hook in ` vite/webpack plugin ` .
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " tailwindcss-patch" ,
3
- "version" : " 0 .0.1 " ,
3
+ "version" : " 1 .0.0 " ,
4
4
"description" : " patch tailwindcss for exposing context" ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/types/index.d.ts" ,
47
47
"@babel/parser" : " ^7.21.4" ,
48
48
"@babel/traverse" : " ^7.21.4" ,
49
49
"@babel/types" : " ^7.21.4" ,
50
- "semver" : " ^7.3.8 "
50
+ "semver" : " ^7.4.0 "
51
51
},
52
52
"homepage" : " https://github.com/sonofmagic/tailwindcss-mangle" ,
53
53
"repository" : {
You can’t perform that action at this time.
0 commit comments