vite-plugin-rnw 0.0.4 → 0.0.5
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 +14 -2
- package/dist/index.js +14 -2
- package/package.json +3 -1
package/dist/index.cjs
CHANGED
|
@@ -25,6 +25,7 @@ const node_path = __toESM(require("node:path"));
|
|
|
25
25
|
const node_url = __toESM(require("node:url"));
|
|
26
26
|
const node_fs = __toESM(require("node:fs"));
|
|
27
27
|
const vite = __toESM(require("vite"));
|
|
28
|
+
const __bunchtogether_vite_plugin_flow = __toESM(require("@bunchtogether/vite-plugin-flow"));
|
|
28
29
|
const vite_plugin_commonjs = __toESM(require("vite-plugin-commonjs"));
|
|
29
30
|
const __rolldown_pluginutils = __toESM(require("@rolldown/pluginutils"));
|
|
30
31
|
|
|
@@ -186,13 +187,23 @@ function rnw(opts = {}) {
|
|
|
186
187
|
},
|
|
187
188
|
optimizeDeps: {
|
|
188
189
|
...initialOptions.optimizeDeps,
|
|
189
|
-
include: ["react-native-reanimated"],
|
|
190
|
+
include: ["react-native-reanimated", "react-native-css-interop"],
|
|
190
191
|
esbuildOptions: {
|
|
191
192
|
...(_initialOptions$optim = initialOptions.optimizeDeps) === null || _initialOptions$optim === void 0 ? void 0 : _initialOptions$optim.esbuildOptions,
|
|
192
193
|
resolveExtensions: extensions,
|
|
193
|
-
loader: { ".js": "jsx" }
|
|
194
|
+
loader: { ".js": "jsx" },
|
|
195
|
+
plugins: [(0, __bunchtogether_vite_plugin_flow.esbuildFlowPlugin)(/* @__PURE__ */ new RegExp(/\.(flow|jsx?)$/), (_path) => "jsx")]
|
|
194
196
|
}
|
|
195
197
|
},
|
|
198
|
+
build: { rollupOptions: {
|
|
199
|
+
treeshake: "safest",
|
|
200
|
+
plugins: [{
|
|
201
|
+
name: "nativewind-fix",
|
|
202
|
+
async transform(code, id) {
|
|
203
|
+
if (id.includes("react-native-css-interop") && id.includes("runtime/components.js")) return { moduleSideEffects: "no-treeshake" };
|
|
204
|
+
}
|
|
205
|
+
}]
|
|
206
|
+
} },
|
|
196
207
|
resolve: {
|
|
197
208
|
extensions,
|
|
198
209
|
alias: { "react-native": "react-native-web" }
|
|
@@ -334,6 +345,7 @@ function rnw(opts = {}) {
|
|
|
334
345
|
}
|
|
335
346
|
};
|
|
336
347
|
return [
|
|
348
|
+
(0, __bunchtogether_vite_plugin_flow.flowPlugin)({ exclude }),
|
|
337
349
|
{
|
|
338
350
|
name: "treat-js-files-as-jsx",
|
|
339
351
|
async transform(code, id) {
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { fileURLToPath } from "node:url";
|
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import * as vite from "vite";
|
|
5
5
|
import { createFilter } from "vite";
|
|
6
|
+
import { esbuildFlowPlugin, flowPlugin } from "@bunchtogether/vite-plugin-flow";
|
|
6
7
|
import commonjs from "vite-plugin-commonjs";
|
|
7
8
|
import { exactRegex, makeIdFiltersToMatchWithQuery } from "@rolldown/pluginutils";
|
|
8
9
|
|
|
@@ -164,13 +165,23 @@ function rnw(opts = {}) {
|
|
|
164
165
|
},
|
|
165
166
|
optimizeDeps: {
|
|
166
167
|
...initialOptions.optimizeDeps,
|
|
167
|
-
include: ["react-native-reanimated"],
|
|
168
|
+
include: ["react-native-reanimated", "react-native-css-interop"],
|
|
168
169
|
esbuildOptions: {
|
|
169
170
|
...(_initialOptions$optim = initialOptions.optimizeDeps) === null || _initialOptions$optim === void 0 ? void 0 : _initialOptions$optim.esbuildOptions,
|
|
170
171
|
resolveExtensions: extensions,
|
|
171
|
-
loader: { ".js": "jsx" }
|
|
172
|
+
loader: { ".js": "jsx" },
|
|
173
|
+
plugins: [esbuildFlowPlugin(/* @__PURE__ */ new RegExp(/\.(flow|jsx?)$/), (_path) => "jsx")]
|
|
172
174
|
}
|
|
173
175
|
},
|
|
176
|
+
build: { rollupOptions: {
|
|
177
|
+
treeshake: "safest",
|
|
178
|
+
plugins: [{
|
|
179
|
+
name: "nativewind-fix",
|
|
180
|
+
async transform(code, id) {
|
|
181
|
+
if (id.includes("react-native-css-interop") && id.includes("runtime/components.js")) return { moduleSideEffects: "no-treeshake" };
|
|
182
|
+
}
|
|
183
|
+
}]
|
|
184
|
+
} },
|
|
174
185
|
resolve: {
|
|
175
186
|
extensions,
|
|
176
187
|
alias: { "react-native": "react-native-web" }
|
|
@@ -312,6 +323,7 @@ function rnw(opts = {}) {
|
|
|
312
323
|
}
|
|
313
324
|
};
|
|
314
325
|
return [
|
|
326
|
+
flowPlugin({ exclude }),
|
|
315
327
|
{
|
|
316
328
|
name: "treat-js-files-as-jsx",
|
|
317
329
|
async transform(code, id) {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.5",
|
|
3
3
|
"name": "vite-plugin-rnw",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
@@ -53,9 +53,11 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@babel/core": "^7.28.0",
|
|
56
|
+
"@babel/plugin-transform-flow-strip-types": "^7.27.1",
|
|
56
57
|
"@babel/plugin-transform-modules-commonjs": "^7.27.1",
|
|
57
58
|
"@babel/plugin-transform-react-jsx-self": "^7.27.1",
|
|
58
59
|
"@babel/plugin-transform-react-jsx-source": "^7.27.1",
|
|
60
|
+
"@bunchtogether/vite-plugin-flow": "^1.0.2",
|
|
59
61
|
"@rolldown/pluginutils": "1.0.0-beta.24",
|
|
60
62
|
"@types/babel__core": "^7.20.5",
|
|
61
63
|
"react-refresh": "^0.17.0",
|