vite-plugin-react-native-web 3.0.1 → 3.1.0
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 +43 -0
- package/dist/cjs/index.js +10 -1
- package/dist/es/index.js +10 -1
- package/package.json +7 -3
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# vite-plugin-react-native-web
|
|
2
|
+
|
|
3
|
+
React Native Web support for Vite.
|
|
4
|
+
|
|
5
|
+
## Peer Dependencies
|
|
6
|
+
|
|
7
|
+
This plugin requires `react-native-web` and `inline-style-prefixer` as peer dependencies. **You must install them in the `node_modules` directory of the app where you use this plugin.**
|
|
8
|
+
|
|
9
|
+
> **Note:** If you are using pnpm or a workspace setup, peer dependencies may be installed in nested `node_modules` folders by default. To avoid issues, ensure both `react-native-web` and `inline-style-prefixer` are installed in the app's own `node_modules` directory:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
pnpm add react-native-web inline-style-prefixer
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Why?
|
|
16
|
+
|
|
17
|
+
- `react-native-web` provides the core React Native compatibility for web.
|
|
18
|
+
- `inline-style-prefixer` is required for style prefixing and is used internally by `react-native-web`.
|
|
19
|
+
|
|
20
|
+
## Example Vite config
|
|
21
|
+
|
|
22
|
+
To ensure correct dependency optimization, add the following to your Vite config:
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
optimizeDeps: {
|
|
26
|
+
include: [
|
|
27
|
+
'inline-style-prefixer/lib/createPrefixer',
|
|
28
|
+
'inline-style-prefixer/lib/plugins/backgroundClip',
|
|
29
|
+
'inline-style-prefixer/lib/plugins/crossFade',
|
|
30
|
+
'inline-style-prefixer/lib/plugins/cursor',
|
|
31
|
+
'inline-style-prefixer/lib/plugins/filter',
|
|
32
|
+
'inline-style-prefixer/lib/plugins/imageSet',
|
|
33
|
+
'inline-style-prefixer/lib/plugins/logical',
|
|
34
|
+
'inline-style-prefixer/lib/plugins/position',
|
|
35
|
+
'inline-style-prefixer/lib/plugins/sizing',
|
|
36
|
+
'inline-style-prefixer/lib/plugins/transition'
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
MIT
|
package/dist/cjs/index.js
CHANGED
|
@@ -81,7 +81,16 @@ const treeshakePreset = {
|
|
|
81
81
|
unknownGlobalSideEffects: true,
|
|
82
82
|
propertyWriteSideEffects: "always"
|
|
83
83
|
};
|
|
84
|
-
const optimizeDepsInclude = [
|
|
84
|
+
const optimizeDepsInclude = [
|
|
85
|
+
"react-native-web",
|
|
86
|
+
"inline-style-prefixer/lib/createPrefixer",
|
|
87
|
+
"inline-style-prefixer/lib/plugins/crossFade",
|
|
88
|
+
"inline-style-prefixer/lib/plugins/imageSet",
|
|
89
|
+
"inline-style-prefixer/lib/plugins/logical",
|
|
90
|
+
"inline-style-prefixer/lib/plugins/position",
|
|
91
|
+
"inline-style-prefixer/lib/plugins/sizing",
|
|
92
|
+
"inline-style-prefixer/lib/plugins/transition"
|
|
93
|
+
];
|
|
85
94
|
const reactNativeWeb = (_options) => ({
|
|
86
95
|
enforce: "pre",
|
|
87
96
|
name: "react-native-web",
|
package/dist/es/index.js
CHANGED
|
@@ -54,7 +54,16 @@ const treeshakePreset = {
|
|
|
54
54
|
unknownGlobalSideEffects: true,
|
|
55
55
|
propertyWriteSideEffects: "always"
|
|
56
56
|
};
|
|
57
|
-
const optimizeDepsInclude = [
|
|
57
|
+
const optimizeDepsInclude = [
|
|
58
|
+
"react-native-web",
|
|
59
|
+
"inline-style-prefixer/lib/createPrefixer",
|
|
60
|
+
"inline-style-prefixer/lib/plugins/crossFade",
|
|
61
|
+
"inline-style-prefixer/lib/plugins/imageSet",
|
|
62
|
+
"inline-style-prefixer/lib/plugins/logical",
|
|
63
|
+
"inline-style-prefixer/lib/plugins/position",
|
|
64
|
+
"inline-style-prefixer/lib/plugins/sizing",
|
|
65
|
+
"inline-style-prefixer/lib/plugins/transition"
|
|
66
|
+
];
|
|
58
67
|
const reactNativeWeb = (_options) => ({
|
|
59
68
|
enforce: "pre",
|
|
60
69
|
name: "react-native-web",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-react-native-web",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"import": "./dist/es/index.js",
|
|
21
21
|
"default": "./dist/cjs/index.js"
|
|
22
22
|
},
|
|
23
|
+
"types": "./types/index.d.ts",
|
|
23
24
|
"engines": {
|
|
24
25
|
"node": ">=14.0.0"
|
|
25
26
|
},
|
|
@@ -44,6 +45,10 @@
|
|
|
44
45
|
"dependencies": {
|
|
45
46
|
"flow-remove-types": "^2.305.0"
|
|
46
47
|
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"inline-style-prefixer": "*",
|
|
50
|
+
"react-native-web": "*"
|
|
51
|
+
},
|
|
47
52
|
"devDependencies": {
|
|
48
53
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
49
54
|
"@types/node": "^25.5.0",
|
|
@@ -51,6 +56,5 @@
|
|
|
51
56
|
"tslib": "^2.8.1",
|
|
52
57
|
"typescript": "^5.9.3",
|
|
53
58
|
"vite": "^8.0.0"
|
|
54
|
-
}
|
|
55
|
-
"types": "./types/index.d.ts"
|
|
59
|
+
}
|
|
56
60
|
}
|