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 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
- "@tailwindcss/postcss": {},
51
- "uniwind-plugin-next/postcss": {}, // Add this line
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.
@@ -1,4 +1,5 @@
1
1
  export default function clientDirectiveLoader(source) {
2
+ console.log(this.resourcePath);
2
3
  // Don't add the directive if it's already present
3
4
  if (source.startsWith('"use client"') || source.startsWith("'use client'")) {
4
5
  return source;
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: /index\.js$/,
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: /index\.js$/,
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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniwind-plugin-next",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Compatibility plugin for using Uniwind with Next.js",
5
5
  "devDependencies": {
6
6
  "@types/node": "^25.0.3",