uniwind-plugin-next 1.1.0 → 1.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 +10 -3
- package/dist/clientDirectiveLoader.js +1 -0
- package/dist/index.cjs +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ Tested on Next `16.1`, but other versions will likely work fine.
|
|
|
18
18
|
## Installation & setup
|
|
19
19
|
This setup guide assumes you already have a next.js project setup with Tailwind v4
|
|
20
20
|
|
|
21
|
-
1. Install uniwind and this plugin
|
|
21
|
+
1. Install uniwind and this plugin. You will probably also need `@expo/next-adapter` if you don't already have it, to handle react-native web support.
|
|
22
22
|
|
|
23
23
|
```shell
|
|
24
24
|
pnpm install uniwind uniwind-plugin-next @expo/next-adapter
|
|
@@ -47,8 +47,8 @@ export default withUniwind(withExpo(nextConfig), {
|
|
|
47
47
|
```js
|
|
48
48
|
const config = {
|
|
49
49
|
plugins: {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
'@tailwindcss/postcss': {},
|
|
51
|
+
'uniwind-plugin-next/postcss': {}, // Add this line
|
|
52
52
|
},
|
|
53
53
|
};
|
|
54
54
|
|
|
@@ -75,6 +75,13 @@ return (
|
|
|
75
75
|
|
|
76
76
|
6. Start the dev server to generate `uniwind-types.d.ts`. Make sure that it's included in your `tsconfig.json`'s `include` array.
|
|
77
77
|
|
|
78
|
+
## SSR Considerations
|
|
79
|
+
- This plugin marks all Uniwind web components with `'use client'` automatically, so you do not need to do this manually.
|
|
80
|
+
|
|
81
|
+
- Be aware that some Uniwind features, such as `withUniwind` and `useResolveClassNames` will not work in a server environment, as they rely on accessing `window` or `document`.
|
|
82
|
+
|
|
83
|
+
-
|
|
84
|
+
|
|
78
85
|
## Known limitations
|
|
79
86
|
|
|
80
87
|
- This plugin uses a much more primitive regex-based postcss plugin for transforming Uniwind CSS functions (`pixelRatio()`, `fontScale()`, `hairlineWidth()`) compared to the official Vite plugin (which uses a full AST parser). As a result, some edge cases may not be handled correctly. If you do not use these functions in your CSS, this will not impact you. If you do run into any issues, please open an issue.
|
package/dist/index.cjs
CHANGED
|
@@ -332,7 +332,8 @@ var UniwindWebpackPlugin = class {
|
|
|
332
332
|
}]
|
|
333
333
|
});
|
|
334
334
|
compiler.options.module.rules.push({
|
|
335
|
-
test:
|
|
335
|
+
test: /\.js$/,
|
|
336
|
+
exclude: /index\.js$/,
|
|
336
337
|
include: /uniwind[\/\\]dist[\/\\]module[\/\\]components[\/\\]web/,
|
|
337
338
|
use: [{ loader: path.default.resolve(__dirname, "clientDirectiveLoader.js") }]
|
|
338
339
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -303,7 +303,8 @@ var UniwindWebpackPlugin = class {
|
|
|
303
303
|
}]
|
|
304
304
|
});
|
|
305
305
|
compiler.options.module.rules.push({
|
|
306
|
-
test:
|
|
306
|
+
test: /\.js$/,
|
|
307
|
+
exclude: /index\.js$/,
|
|
307
308
|
include: /uniwind[\/\\]dist[\/\\]module[\/\\]components[\/\\]web/,
|
|
308
309
|
use: [{ loader: path.resolve(__dirname, "clientDirectiveLoader.js") }]
|
|
309
310
|
});
|