vite-plugin-react-native 0.0.3 → 0.0.4
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/dist/index.cjs +24 -2
- package/dist/index.js +24 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -60,12 +60,17 @@ function reactNative() {
|
|
|
60
60
|
const userResolveExtensions = Array.isArray(userConfig.resolve?.extensions) ? userConfig.resolve?.extensions : null;
|
|
61
61
|
const userOptimizeDepsExclude = Array.isArray(userConfig.optimizeDeps?.exclude) ? userConfig.optimizeDeps?.exclude : [];
|
|
62
62
|
const userOptimizeDepsInclude = Array.isArray(userConfig.optimizeDeps?.include) ? userConfig.optimizeDeps?.include : [];
|
|
63
|
+
const userOptimizeDepsEsbuildOptions = userConfig.optimizeDeps?.esbuildOptions && typeof userConfig.optimizeDeps.esbuildOptions === "object" ? userConfig.optimizeDeps.esbuildOptions : {};
|
|
63
64
|
const config = {
|
|
64
65
|
resolve: {
|
|
65
66
|
alias: [
|
|
66
67
|
...userAliasArray,
|
|
67
68
|
{ find: /^react-native$/, replacement: "react-native-web" },
|
|
68
|
-
{ find: /^react-native-router-dom$/, replacement: routerDomEntry }
|
|
69
|
+
{ find: /^react-native-router-dom$/, replacement: routerDomEntry },
|
|
70
|
+
{ find: /^inline-style-prefixer\/lib\/plugins\/(.*)$/, replacement: "inline-style-prefixer/es/plugins/$1" },
|
|
71
|
+
{ find: "react-native/Libraries/EventEmitter/RCTDeviceEventEmitter", replacement: "react-native-web/dist/vendor/react-native/NativeEventEmitter/RCTDeviceEventEmitter" },
|
|
72
|
+
{ find: "react-native/Libraries/vendor/emitter/EventEmitter", replacement: "react-native-web/dist/vendor/react-native/emitter/EventEmitter" },
|
|
73
|
+
{ find: "react-native/Libraries/EventEmitter/NativeEventEmitter", replacement: "react-native-web/dist/vendor/react-native/NativeEventEmitter" }
|
|
69
74
|
],
|
|
70
75
|
dedupe: ["react", "react-dom"],
|
|
71
76
|
extensions: userResolveExtensions ? void 0 : webResolveExtensions
|
|
@@ -83,6 +88,14 @@ function reactNative() {
|
|
|
83
88
|
global: "globalThis"
|
|
84
89
|
},
|
|
85
90
|
optimizeDeps: {
|
|
91
|
+
esbuildOptions: {
|
|
92
|
+
...userOptimizeDepsEsbuildOptions,
|
|
93
|
+
resolveExtensions: "resolveExtensions" in userOptimizeDepsEsbuildOptions ? userOptimizeDepsEsbuildOptions.resolveExtensions : userResolveExtensions ?? webResolveExtensions,
|
|
94
|
+
loader: {
|
|
95
|
+
..."loader" in userOptimizeDepsEsbuildOptions ? userOptimizeDepsEsbuildOptions.loader : {},
|
|
96
|
+
".js": "jsx"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
86
99
|
include: uniqueStrings([
|
|
87
100
|
...userOptimizeDepsInclude,
|
|
88
101
|
"react",
|
|
@@ -90,7 +103,16 @@ function reactNative() {
|
|
|
90
103
|
"react/jsx-runtime",
|
|
91
104
|
"react/jsx-dev-runtime",
|
|
92
105
|
"hoist-non-react-statics",
|
|
93
|
-
"invariant"
|
|
106
|
+
"invariant",
|
|
107
|
+
"react-native-web",
|
|
108
|
+
"react-native-reanimated",
|
|
109
|
+
"react-native-css-interop",
|
|
110
|
+
"react-native-router-dom",
|
|
111
|
+
"react-native-i18njs",
|
|
112
|
+
"@react-native/normalize-colors",
|
|
113
|
+
"inline-style-prefixer",
|
|
114
|
+
"inline-style-prefixer/lib/plugins/crossFade",
|
|
115
|
+
"css-in-js-utils"
|
|
94
116
|
]),
|
|
95
117
|
exclude: uniqueStrings([
|
|
96
118
|
...userOptimizeDepsExclude,
|
package/dist/index.js
CHANGED
|
@@ -52,12 +52,17 @@ function reactNative() {
|
|
|
52
52
|
const userResolveExtensions = Array.isArray(userConfig.resolve?.extensions) ? userConfig.resolve?.extensions : null;
|
|
53
53
|
const userOptimizeDepsExclude = Array.isArray(userConfig.optimizeDeps?.exclude) ? userConfig.optimizeDeps?.exclude : [];
|
|
54
54
|
const userOptimizeDepsInclude = Array.isArray(userConfig.optimizeDeps?.include) ? userConfig.optimizeDeps?.include : [];
|
|
55
|
+
const userOptimizeDepsEsbuildOptions = userConfig.optimizeDeps?.esbuildOptions && typeof userConfig.optimizeDeps.esbuildOptions === "object" ? userConfig.optimizeDeps.esbuildOptions : {};
|
|
55
56
|
const config = {
|
|
56
57
|
resolve: {
|
|
57
58
|
alias: [
|
|
58
59
|
...userAliasArray,
|
|
59
60
|
{ find: /^react-native$/, replacement: "react-native-web" },
|
|
60
|
-
{ find: /^react-native-router-dom$/, replacement: routerDomEntry }
|
|
61
|
+
{ find: /^react-native-router-dom$/, replacement: routerDomEntry },
|
|
62
|
+
{ find: /^inline-style-prefixer\/lib\/plugins\/(.*)$/, replacement: "inline-style-prefixer/es/plugins/$1" },
|
|
63
|
+
{ find: "react-native/Libraries/EventEmitter/RCTDeviceEventEmitter", replacement: "react-native-web/dist/vendor/react-native/NativeEventEmitter/RCTDeviceEventEmitter" },
|
|
64
|
+
{ find: "react-native/Libraries/vendor/emitter/EventEmitter", replacement: "react-native-web/dist/vendor/react-native/emitter/EventEmitter" },
|
|
65
|
+
{ find: "react-native/Libraries/EventEmitter/NativeEventEmitter", replacement: "react-native-web/dist/vendor/react-native/NativeEventEmitter" }
|
|
61
66
|
],
|
|
62
67
|
dedupe: ["react", "react-dom"],
|
|
63
68
|
extensions: userResolveExtensions ? void 0 : webResolveExtensions
|
|
@@ -75,6 +80,14 @@ function reactNative() {
|
|
|
75
80
|
global: "globalThis"
|
|
76
81
|
},
|
|
77
82
|
optimizeDeps: {
|
|
83
|
+
esbuildOptions: {
|
|
84
|
+
...userOptimizeDepsEsbuildOptions,
|
|
85
|
+
resolveExtensions: "resolveExtensions" in userOptimizeDepsEsbuildOptions ? userOptimizeDepsEsbuildOptions.resolveExtensions : userResolveExtensions ?? webResolveExtensions,
|
|
86
|
+
loader: {
|
|
87
|
+
..."loader" in userOptimizeDepsEsbuildOptions ? userOptimizeDepsEsbuildOptions.loader : {},
|
|
88
|
+
".js": "jsx"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
78
91
|
include: uniqueStrings([
|
|
79
92
|
...userOptimizeDepsInclude,
|
|
80
93
|
"react",
|
|
@@ -82,7 +95,16 @@ function reactNative() {
|
|
|
82
95
|
"react/jsx-runtime",
|
|
83
96
|
"react/jsx-dev-runtime",
|
|
84
97
|
"hoist-non-react-statics",
|
|
85
|
-
"invariant"
|
|
98
|
+
"invariant",
|
|
99
|
+
"react-native-web",
|
|
100
|
+
"react-native-reanimated",
|
|
101
|
+
"react-native-css-interop",
|
|
102
|
+
"react-native-router-dom",
|
|
103
|
+
"react-native-i18njs",
|
|
104
|
+
"@react-native/normalize-colors",
|
|
105
|
+
"inline-style-prefixer",
|
|
106
|
+
"inline-style-prefixer/lib/plugins/crossFade",
|
|
107
|
+
"css-in-js-utils"
|
|
86
108
|
]),
|
|
87
109
|
exclude: uniqueStrings([
|
|
88
110
|
...userOptimizeDepsExclude,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-react-native",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Vite plugin for React Native web compatibility",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -45,4 +45,4 @@
|
|
|
45
45
|
"typescript": "^5.0.0",
|
|
46
46
|
"vite": "^7.0.0"
|
|
47
47
|
}
|
|
48
|
-
}
|
|
48
|
+
}
|