vxrn 1.2.46 → 1.2.48
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/cli.js +6 -2
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs.map +1 -1
- package/dist/cli.native.js.map +1 -1
- package/dist/config/getBaseVitePlugins.js.map +1 -1
- package/dist/config/getBaseVitePlugins.mjs.map +1 -1
- package/dist/config/getBaseVitePlugins.native.js.map +1 -1
- package/dist/config/getOptionsFilled.js +2 -2
- package/dist/config/getOptionsFilled.js.map +1 -1
- package/dist/config/getOptionsFilled.mjs +2 -2
- package/dist/config/getOptionsFilled.mjs.map +1 -1
- package/dist/config/getOptionsFilled.native.js +2 -2
- package/dist/config/getOptionsFilled.native.js.map +1 -1
- package/dist/config/getReactNativeBuildConfig.js +7 -2
- package/dist/config/getReactNativeBuildConfig.js.map +1 -1
- package/dist/config/getReactNativeBuildConfig.mjs.map +1 -1
- package/dist/config/getReactNativeBuildConfig.native.js.map +1 -1
- package/dist/config/getServerOptionsFilled.js +1 -1
- package/dist/config/getServerOptionsFilled.js.map +1 -1
- package/dist/config/getServerOptionsFilled.mjs +1 -1
- package/dist/config/getServerOptionsFilled.mjs.map +1 -1
- package/dist/config/getServerOptionsFilled.native.js +3 -2
- package/dist/config/getServerOptionsFilled.native.js.map +1 -1
- package/dist/config/getViteServerConfig.js.map +1 -1
- package/dist/config/getViteServerConfig.mjs.map +1 -1
- package/dist/config/getViteServerConfig.native.js.map +1 -1
- package/dist/config/mergeUserConfig.js +3 -3
- package/dist/config/mergeUserConfig.js.map +1 -1
- package/dist/config/mergeUserConfig.mjs +3 -3
- package/dist/config/mergeUserConfig.mjs.map +1 -1
- package/dist/config/mergeUserConfig.native.js +3 -3
- package/dist/config/mergeUserConfig.native.js.map +1 -1
- package/dist/exports/build.js +12 -4
- package/dist/exports/build.js.map +1 -1
- package/dist/exports/build.mjs.map +1 -1
- package/dist/exports/build.native.js.map +1 -1
- package/dist/exports/dev.js +1 -1
- package/dist/exports/dev.js.map +1 -1
- package/dist/exports/dev.mjs +1 -1
- package/dist/exports/dev.mjs.map +1 -1
- package/dist/exports/dev.native.js +1 -1
- package/dist/exports/dev.native.js.map +1 -1
- package/dist/exports/loadEnv.js.map +1 -1
- package/dist/exports/loadEnv.mjs.map +1 -1
- package/dist/exports/loadEnv.native.js.map +1 -1
- package/dist/exports/prebuild.js +4 -1
- package/dist/exports/prebuild.js.map +1 -1
- package/dist/exports/prebuild.mjs.map +1 -1
- package/dist/exports/prebuild.native.js.map +1 -1
- package/dist/exports/serveStaticAssets.js.map +1 -1
- package/dist/exports/serveStaticAssets.mjs.map +1 -1
- package/dist/exports/serveStaticAssets.native.js.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.js.map +1 -1
- package/dist/patches/builtInDepPatches.js +44 -4
- package/dist/patches/builtInDepPatches.js.map +1 -1
- package/dist/patches/builtInDepPatches.mjs +21 -1
- package/dist/patches/builtInDepPatches.mjs.map +1 -1
- package/dist/patches/builtInDepPatches.native.js +25 -1
- package/dist/patches/builtInDepPatches.native.js.map +1 -1
- package/dist/plugins/autoDepOptimizePlugin.js +17 -4
- package/dist/plugins/autoDepOptimizePlugin.js.map +1 -1
- package/dist/plugins/autoDepOptimizePlugin.mjs.map +1 -1
- package/dist/plugins/autoDepOptimizePlugin.native.js.map +1 -1
- package/dist/plugins/expoManifestRequestHandlerPlugin.js +12 -11
- package/dist/plugins/expoManifestRequestHandlerPlugin.js.map +1 -1
- package/dist/plugins/expoManifestRequestHandlerPlugin.mjs +1 -1
- package/dist/plugins/expoManifestRequestHandlerPlugin.mjs.map +1 -1
- package/dist/plugins/expoManifestRequestHandlerPlugin.native.js +1 -1
- package/dist/plugins/expoManifestRequestHandlerPlugin.native.js.map +1 -1
- package/dist/plugins/reactNativeCommonJsPlugin.js +4 -2
- package/dist/plugins/reactNativeCommonJsPlugin.js.map +1 -1
- package/dist/plugins/reactNativeCommonJsPlugin.mjs +1 -1
- package/dist/plugins/reactNativeCommonJsPlugin.mjs.map +1 -1
- package/dist/plugins/reactNativeCommonJsPlugin.native.js +1 -1
- package/dist/plugins/reactNativeCommonJsPlugin.native.js.map +1 -1
- package/dist/plugins/reactNativeDevAssetPlugin.js +16 -2
- package/dist/plugins/reactNativeDevAssetPlugin.js.map +1 -1
- package/dist/plugins/reactNativeDevAssetPlugin.mjs.map +1 -1
- package/dist/plugins/reactNativeDevAssetPlugin.native.js.map +1 -1
- package/dist/plugins/reactNativeHMRPlugin.js +17 -3
- package/dist/plugins/reactNativeHMRPlugin.js.map +1 -1
- package/dist/plugins/reactNativeHMRPlugin.mjs.map +1 -1
- package/dist/plugins/reactNativeHMRPlugin.native.js.map +1 -1
- package/dist/plugins/resolveIdScan.test.js +3 -6
- package/dist/plugins/resolveIdScan.test.js.map +1 -1
- package/dist/plugins/resolveIdScan.test.mjs.map +1 -1
- package/dist/plugins/resolveIdScan.test.native.js.map +1 -1
- package/dist/plugins/rollupRemoveUnusedImports.js +1 -1
- package/dist/plugins/rollupRemoveUnusedImports.js.map +1 -1
- package/dist/plugins/rollupRemoveUnusedImports.mjs +1 -1
- package/dist/plugins/rollupRemoveUnusedImports.mjs.map +1 -1
- package/dist/plugins/rollupRemoveUnusedImports.native.js +1 -1
- package/dist/plugins/rollupRemoveUnusedImports.native.js.map +1 -1
- package/dist/rn-commands/bundle/buildBundle.js +3 -5
- package/dist/rn-commands/bundle/buildBundle.js.map +1 -1
- package/dist/rn-commands/bundle/buildBundle.mjs +10 -13
- package/dist/rn-commands/bundle/buildBundle.mjs.map +1 -1
- package/dist/rn-commands/bundle/buildBundle.native.js +3 -5
- package/dist/rn-commands/bundle/buildBundle.native.js.map +1 -1
- package/dist/user-interface/index.js +15 -6
- package/dist/user-interface/index.js.map +1 -1
- package/dist/user-interface/index.mjs.map +1 -1
- package/dist/user-interface/index.native.js.map +1 -1
- package/dist/utils/expoRun.js +4 -2
- package/dist/utils/expoRun.js.map +1 -1
- package/dist/utils/expoRun.mjs.map +1 -1
- package/dist/utils/expoRun.native.js.map +1 -1
- package/dist/utils/getReactNativeBundle.js +12 -7
- package/dist/utils/getReactNativeBundle.js.map +1 -1
- package/dist/utils/getReactNativeBundle.mjs.map +1 -1
- package/dist/utils/getReactNativeBundle.native.js.map +1 -1
- package/dist/utils/getVitePath.js.map +1 -1
- package/dist/utils/getVitePath.mjs.map +1 -1
- package/dist/utils/getVitePath.native.js.map +1 -1
- package/dist/utils/patches.js +12 -3
- package/dist/utils/patches.js.map +1 -1
- package/dist/utils/patches.mjs.map +1 -1
- package/dist/utils/patches.native.js.map +1 -1
- package/dist/utils/scanDepsToOptimize.js +8 -3
- package/dist/utils/scanDepsToOptimize.js.map +1 -1
- package/dist/utils/scanDepsToOptimize.mjs +1 -1
- package/dist/utils/scanDepsToOptimize.mjs.map +1 -1
- package/dist/utils/scanDepsToOptimize.native.js +1 -1
- package/dist/utils/scanDepsToOptimize.native.js.map +1 -1
- package/dist/utils/swapPrebuiltReactModules.js +8 -2
- package/dist/utils/swapPrebuiltReactModules.js.map +1 -1
- package/dist/utils/swapPrebuiltReactModules.mjs.map +1 -1
- package/dist/utils/swapPrebuiltReactModules.native.js.map +1 -1
- package/dist/utils/utils.js.map +1 -1
- package/dist/utils/utils.mjs.map +1 -1
- package/dist/utils/utils.native.js.map +1 -1
- package/dist/worker.js +15 -12
- package/dist/worker.js.map +1 -1
- package/dist/worker.mjs.map +1 -1
- package/dist/worker.native.js.map +1 -1
- package/expo-js-native-debugging-plugin.cjs +9 -2
- package/expo-plugin.cjs +26 -9
- package/package.json +13 -13
- package/react-native-template.js +25 -13
- package/src/cli.ts +12 -5
- package/src/config/getBaseVitePlugins.ts +4 -1
- package/src/config/getOptionsFilled.ts +9 -4
- package/src/config/getReactNativeBuildConfig.ts +7 -2
- package/src/config/getServerOptionsFilled.ts +4 -1
- package/src/config/getViteServerConfig.ts +4 -1
- package/src/config/mergeUserConfig.ts +3 -3
- package/src/exports/build.ts +16 -5
- package/src/exports/dev.ts +3 -2
- package/src/exports/loadEnv.ts +17 -11
- package/src/exports/prebuild.ts +13 -3
- package/src/exports/serveStaticAssets.ts +4 -1
- package/src/index.ts +5 -1
- package/src/patches/builtInDepPatches.ts +58 -4
- package/src/plugins/autoDepOptimizePlugin.ts +18 -5
- package/src/plugins/clientInjectPlugin.ts +1 -1
- package/src/plugins/expoManifestRequestHandlerPlugin.ts +23 -19
- package/src/plugins/reactNativeCommonJsPlugin.ts +4 -2
- package/src/plugins/reactNativeDevAssetPlugin.ts +22 -4
- package/src/plugins/reactNativeHMRPlugin.ts +18 -4
- package/src/plugins/resolveIdScan.test.ts +8 -7
- package/src/plugins/rollupRemoveUnusedImports.ts +1 -1
- package/src/rn-commands/bundle/buildBundle.ts +1 -3
- package/src/types.ts +14 -3
- package/src/user-interface/index.ts +21 -6
- package/src/utils/expoRun.ts +8 -2
- package/src/utils/getReactNativeBundle.ts +13 -7
- package/src/utils/getVitePath.ts +4 -1
- package/src/utils/patches.ts +20 -6
- package/src/utils/scanDepsToOptimize.ts +16 -6
- package/src/utils/swapPrebuiltReactModules.ts +13 -3
- package/src/utils/utils.ts +4 -1
- package/src/worker.ts +19 -16
- package/types/config/getBaseVitePlugins.d.ts.map +1 -1
- package/types/config/getOptionsFilled.d.ts.map +1 -1
- package/types/config/getServerOptionsFilled.d.ts.map +1 -1
- package/types/config/getViteServerConfig.d.ts.map +1 -1
- package/types/exports/build.d.ts.map +1 -1
- package/types/exports/dev.d.ts.map +1 -1
- package/types/exports/loadEnv.d.ts.map +1 -1
- package/types/exports/prebuild.d.ts.map +1 -1
- package/types/exports/serveStaticAssets.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/patches/builtInDepPatches.d.ts.map +1 -1
- package/types/plugins/autoDepOptimizePlugin.d.ts +1 -1
- package/types/plugins/autoDepOptimizePlugin.d.ts.map +1 -1
- package/types/plugins/expoManifestRequestHandlerPlugin.d.ts.map +1 -1
- package/types/plugins/reactNativeCommonJsPlugin.d.ts.map +1 -1
- package/types/plugins/reactNativeDevAssetPlugin.d.ts.map +1 -1
- package/types/plugins/reactNativeHMRPlugin.d.ts.map +1 -1
- package/types/rn-commands/bundle/buildBundle.d.ts.map +1 -1
- package/types/types.d.ts.map +1 -1
- package/types/utils/expoRun.d.ts.map +1 -1
- package/types/utils/getReactNativeBundle.d.ts.map +1 -1
- package/types/utils/getVitePath.d.ts.map +1 -1
- package/types/utils/patches.d.ts.map +1 -1
- package/types/utils/scanDepsToOptimize.d.ts.map +1 -1
- package/types/utils/swapPrebuiltReactModules.d.ts.map +1 -1
- package/types/utils/utils.d.ts.map +1 -1
- /package/types/utils/{filterPluginsForNative.d.ts → filterPluginsforNative.d.ts} +0 -0
|
@@ -114,7 +114,9 @@ export function reactNativeHMRPlugin({
|
|
|
114
114
|
|
|
115
115
|
source = transformResult.code
|
|
116
116
|
} catch (e) {
|
|
117
|
-
console.warn(
|
|
117
|
+
console.warn(
|
|
118
|
+
`Error transforming source for HMR: ${e}. Retrying without plugins.`
|
|
119
|
+
)
|
|
118
120
|
source = (await transformSWCStripJSX(id, source))?.code || ''
|
|
119
121
|
}
|
|
120
122
|
|
|
@@ -155,11 +157,20 @@ export function reactNativeHMRPlugin({
|
|
|
155
157
|
const resolver: ResolveFn = idResolver.bind(null, environment)
|
|
156
158
|
const resolverWithPlugins: ResolveFn = async (id, importer) => {
|
|
157
159
|
// Need this since `idResolver` will not run through user plugins, but we might need plugins like `vite-tsconfig-paths` to work if they are used
|
|
158
|
-
const resolvedIdData = await environment.pluginContainer.resolveId(
|
|
160
|
+
const resolvedIdData = await environment.pluginContainer.resolveId(
|
|
161
|
+
id,
|
|
162
|
+
importer
|
|
163
|
+
)
|
|
159
164
|
return resolvedIdData?.id
|
|
160
165
|
}
|
|
161
166
|
|
|
162
|
-
let id = await getVitePath(
|
|
167
|
+
let id = await getVitePath(
|
|
168
|
+
entryRoot,
|
|
169
|
+
file,
|
|
170
|
+
importName,
|
|
171
|
+
resolver,
|
|
172
|
+
resolverWithPlugins
|
|
173
|
+
)
|
|
163
174
|
if (!id) {
|
|
164
175
|
console.warn('???')
|
|
165
176
|
continue
|
|
@@ -207,7 +218,10 @@ export function reactNativeHMRPlugin({
|
|
|
207
218
|
${source
|
|
208
219
|
.replace(`import.meta.hot.accept(() => {})`, ``)
|
|
209
220
|
// replace import.meta.glob with empty array in hot reloads
|
|
210
|
-
.replaceAll(
|
|
221
|
+
.replaceAll(
|
|
222
|
+
/import.meta.glob\(.*\)/gi,
|
|
223
|
+
`globalThis['__importMetaGlobbed'] || {}`
|
|
224
|
+
)};
|
|
211
225
|
return exports })({})`
|
|
212
226
|
|
|
213
227
|
if (process.env.DEBUG) {
|
|
@@ -20,7 +20,11 @@ describe('resolveId hooks should skip during dep optimization scan', () => {
|
|
|
20
20
|
|
|
21
21
|
// Find the platform-specific-resolve plugin
|
|
22
22
|
const plugin = plugins.find(
|
|
23
|
-
(p) =>
|
|
23
|
+
(p) =>
|
|
24
|
+
typeof p === 'object' &&
|
|
25
|
+
p !== null &&
|
|
26
|
+
'name' in p &&
|
|
27
|
+
p.name === 'platform-specific-resolve'
|
|
24
28
|
)
|
|
25
29
|
|
|
26
30
|
expect(plugin).toBeDefined()
|
|
@@ -37,12 +41,9 @@ describe('resolveId hooks should skip during dep optimization scan', () => {
|
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
// When scan is true, should return undefined (skip processing)
|
|
40
|
-
const result = await resolveId.call(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
'/importer.ts',
|
|
44
|
-
{ scan: true }
|
|
45
|
-
)
|
|
44
|
+
const result = await resolveId.call(mockContext, 'some-module', '/importer.ts', {
|
|
45
|
+
scan: true,
|
|
46
|
+
})
|
|
46
47
|
|
|
47
48
|
expect(result).toBeUndefined()
|
|
48
49
|
// Should NOT have called resolve when scan is true
|
|
@@ -4,7 +4,7 @@ export const rollupRemoveUnusedImportsPlugin = {
|
|
|
4
4
|
// Use a simple regex or AST parser to remove unused imports
|
|
5
5
|
// Here, we use a regex to remove all imports, adapt as needed
|
|
6
6
|
return {
|
|
7
|
-
code: code.replace(/import\s+['"][a-zA-Z0-
|
|
7
|
+
code: code.replace(/import\s+['"][a-zA-Z0-9_\-@]+['"];\n/g, ''),
|
|
8
8
|
map: null,
|
|
9
9
|
}
|
|
10
10
|
},
|
|
@@ -92,9 +92,7 @@ export async function buildBundle(
|
|
|
92
92
|
const optionsIn = {
|
|
93
93
|
root,
|
|
94
94
|
host: '0.0.0.0', // TODO: Hardcoded for now.
|
|
95
|
-
entries: {
|
|
96
|
-
...(nativeEntry ? { native: nativeEntry } : {}),
|
|
97
|
-
},
|
|
95
|
+
entries: nativeEntry ? { native: nativeEntry } : {},
|
|
98
96
|
}
|
|
99
97
|
|
|
100
98
|
const options = await fillOptions(optionsIn, { mode: dev ? 'dev' : 'prod' })
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { Hono } from 'hono'
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
OutputAsset,
|
|
4
|
+
OutputChunk,
|
|
5
|
+
TreeshakingOptions,
|
|
6
|
+
TreeshakingPreset,
|
|
7
|
+
} from 'rollup'
|
|
3
8
|
import type { FilterPattern, InlineConfig, UserConfig } from 'vite'
|
|
4
9
|
|
|
5
10
|
type RollupOutputList = [OutputChunk, ...(OutputChunk | OutputAsset)[]]
|
|
@@ -137,6 +142,12 @@ export type VXRNServeOptionsFilled = Required<VXRNServeOptionsBase> & {
|
|
|
137
142
|
|
|
138
143
|
export type VXRNServeOptions = VXRNServeOptionsBase & {
|
|
139
144
|
app?: Hono
|
|
140
|
-
beforeRegisterRoutes?: (
|
|
141
|
-
|
|
145
|
+
beforeRegisterRoutes?: (
|
|
146
|
+
options: VXRNServeOptionsFilled,
|
|
147
|
+
app: Hono
|
|
148
|
+
) => void | Promise<void>
|
|
149
|
+
afterRegisterRoutes?: (
|
|
150
|
+
options: VXRNServeOptionsFilled,
|
|
151
|
+
app: Hono
|
|
152
|
+
) => void | Promise<void>
|
|
142
153
|
}
|
|
@@ -132,7 +132,10 @@ export async function startUserInterface(context: Context) {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
function printCommandsTable(context: Context) {
|
|
135
|
-
const longestKeyLength = COMMANDS.reduce(
|
|
135
|
+
const longestKeyLength = COMMANDS.reduce(
|
|
136
|
+
(max, command) => Math.max(max, command.keys.length),
|
|
137
|
+
0
|
|
138
|
+
)
|
|
136
139
|
|
|
137
140
|
const commandsInfo = COMMANDS.map((cmd) =>
|
|
138
141
|
getCommandInfoInTerminal(cmd, { longestKeyLength })
|
|
@@ -214,12 +217,16 @@ function handleKeypress(context: Context, key: string) {
|
|
|
214
217
|
|
|
215
218
|
if (pressedKeys.length >= 3) {
|
|
216
219
|
clearPrintedInfo()
|
|
217
|
-
console.info(
|
|
220
|
+
console.info(
|
|
221
|
+
`> ${pressedKeys}\nNo matching command for "${pressedKeys}"! Press "?" for help.`
|
|
222
|
+
)
|
|
218
223
|
pressedKeys = ''
|
|
219
224
|
return
|
|
220
225
|
}
|
|
221
226
|
|
|
222
|
-
const possibleCommands = COMMANDS.filter((command) =>
|
|
227
|
+
const possibleCommands = COMMANDS.filter((command) =>
|
|
228
|
+
command.keys.startsWith(pressedKeys)
|
|
229
|
+
)
|
|
223
230
|
|
|
224
231
|
const commandsInfo = possibleCommands
|
|
225
232
|
.map((command) => {
|
|
@@ -260,7 +267,11 @@ async function printNativeQrCodeAndInstructions(url: string) {
|
|
|
260
267
|
|
|
261
268
|
function nativeOpen(url: string) {
|
|
262
269
|
const start =
|
|
263
|
-
process.platform === 'darwin'
|
|
270
|
+
process.platform === 'darwin'
|
|
271
|
+
? 'open'
|
|
272
|
+
: process.platform === 'win32'
|
|
273
|
+
? 'start'
|
|
274
|
+
: 'xdg-open'
|
|
264
275
|
|
|
265
276
|
exec(`${start} ${url}`)
|
|
266
277
|
}
|
|
@@ -310,7 +321,9 @@ async function openAndroid(ctx: Context) {
|
|
|
310
321
|
paths: [projectRoot],
|
|
311
322
|
}
|
|
312
323
|
)
|
|
313
|
-
const androidPlatformManagerModule = await import(
|
|
324
|
+
const androidPlatformManagerModule = await import(
|
|
325
|
+
androidPlatformManagerModuleImportPath
|
|
326
|
+
)
|
|
314
327
|
const PlatformManager = androidPlatformManagerModule.default.AndroidPlatformManager
|
|
315
328
|
|
|
316
329
|
// TODO: Support dev client
|
|
@@ -327,7 +340,9 @@ async function openAndroid(ctx: Context) {
|
|
|
327
340
|
await platformManager.openAsync({ runtime: 'expo' })
|
|
328
341
|
} catch (e) {
|
|
329
342
|
const stack = e instanceof Error ? e.stack : null
|
|
330
|
-
console.error(
|
|
343
|
+
console.error(
|
|
344
|
+
`Failed to open app in Android Emulator: ${e}${stack ? `\n${stack}` : ''}`
|
|
345
|
+
)
|
|
331
346
|
}
|
|
332
347
|
}
|
|
333
348
|
|
package/src/utils/expoRun.ts
CHANGED
|
@@ -6,7 +6,11 @@ export async function expoRun({
|
|
|
6
6
|
root,
|
|
7
7
|
platform,
|
|
8
8
|
port,
|
|
9
|
-
}: {
|
|
9
|
+
}: {
|
|
10
|
+
root: string
|
|
11
|
+
platform: 'ios' | 'android'
|
|
12
|
+
port?: number
|
|
13
|
+
}) {
|
|
10
14
|
const options = await fillOptions({ root })
|
|
11
15
|
|
|
12
16
|
applyBuiltInPatches(options).catch((err) => {
|
|
@@ -30,6 +34,8 @@ export async function expoRun({
|
|
|
30
34
|
// `${port || 8081}`,
|
|
31
35
|
])
|
|
32
36
|
} catch (e) {
|
|
33
|
-
console.error(
|
|
37
|
+
console.error(
|
|
38
|
+
`Failed to run native project: ${e}\nIs "expo" listed in your dependencies?`
|
|
39
|
+
)
|
|
34
40
|
}
|
|
35
41
|
}
|
|
@@ -7,7 +7,10 @@ import type { VXRNOptionsFilled } from '../config/getOptionsFilled'
|
|
|
7
7
|
import { getReactNativeBuildConfig } from '../config/getReactNativeBuildConfig'
|
|
8
8
|
import { filterPluginsForNative } from './filterPluginsForNative'
|
|
9
9
|
import { getCacheDir } from './getCacheDir'
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
isBuildingNativeBundle,
|
|
12
|
+
setIsBuildingNativeBundle,
|
|
13
|
+
} from './isBuildingNativeBundle'
|
|
11
14
|
import { prebuildReactNativeModules } from './swapPrebuiltReactModules'
|
|
12
15
|
|
|
13
16
|
// used for normalizing hot reloads
|
|
@@ -58,7 +61,9 @@ export async function getReactNativeBundle(
|
|
|
58
61
|
// build app
|
|
59
62
|
const nativeBuildConfig = await getReactNativeBuildConfig(options, internal, platform)
|
|
60
63
|
|
|
61
|
-
nativeBuildConfig.plugins = filterPluginsForNative(nativeBuildConfig.plugins, {
|
|
64
|
+
nativeBuildConfig.plugins = filterPluginsForNative(nativeBuildConfig.plugins, {
|
|
65
|
+
isNative: true,
|
|
66
|
+
})
|
|
62
67
|
|
|
63
68
|
// instrument plugins:
|
|
64
69
|
const buildStats: Record<string, number> = {}
|
|
@@ -125,10 +130,8 @@ export async function getReactNativeBundle(
|
|
|
125
130
|
const importsMap = {}
|
|
126
131
|
for (const imp of outputModule.imports) {
|
|
127
132
|
const relativePath = relative(dirname(id), imp)
|
|
128
|
-
importsMap[relativePath[0] === '.' ? relativePath : './' + relativePath] =
|
|
129
|
-
/.*node_modules\//,
|
|
130
|
-
''
|
|
131
|
-
)
|
|
133
|
+
importsMap[relativePath[0] === '.' ? relativePath : './' + relativePath] =
|
|
134
|
+
imp.replace(/.*node_modules\//, '')
|
|
132
135
|
}
|
|
133
136
|
|
|
134
137
|
let code = outputModule.code
|
|
@@ -222,7 +225,10 @@ async function getReactNativeTemplate(mode: 'dev' | 'prod') {
|
|
|
222
225
|
template = template.replace(/process\.env\.DEBUG/g, 'undefined')
|
|
223
226
|
|
|
224
227
|
// In production mode, the prebuilt modules have `.production` in their filenames
|
|
225
|
-
template = template.replaceAll(
|
|
228
|
+
template = template.replaceAll(
|
|
229
|
+
'.vxrn/react-jsx-runtime.js',
|
|
230
|
+
'.vxrn/react-jsx-runtime.production.js'
|
|
231
|
+
)
|
|
226
232
|
template = template.replaceAll('.vxrn/react.js', '.vxrn/react.production.js')
|
|
227
233
|
// react-native already has platform in filename, need to add .production before platform
|
|
228
234
|
template = template.replace(
|
package/src/utils/getVitePath.ts
CHANGED
|
@@ -7,7 +7,10 @@ export async function getVitePath(
|
|
|
7
7
|
importer: string,
|
|
8
8
|
moduleName: string,
|
|
9
9
|
resolver: (moduleName: string, importer: string) => Promise<string | undefined>,
|
|
10
|
-
resolverWithPlugins: (
|
|
10
|
+
resolverWithPlugins: (
|
|
11
|
+
moduleName: string,
|
|
12
|
+
importer: string
|
|
13
|
+
) => Promise<string | undefined>,
|
|
11
14
|
absolute = false
|
|
12
15
|
) {
|
|
13
16
|
// our virtual modules
|
package/src/utils/patches.ts
CHANGED
|
@@ -22,7 +22,9 @@ export type DepFileStrategy =
|
|
|
22
22
|
|
|
23
23
|
export type DepPatch = {
|
|
24
24
|
module: string
|
|
25
|
-
patchFiles: { optimize?: DepOptimize; version?: string } & {
|
|
25
|
+
patchFiles: { optimize?: DepOptimize; version?: string } & {
|
|
26
|
+
[key: string]: DepFileStrategy
|
|
27
|
+
}
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
class Bail extends Error {}
|
|
@@ -55,7 +57,11 @@ export async function applyBuiltInPatches(
|
|
|
55
57
|
if (existing) {
|
|
56
58
|
for (const patchKey in extraPatchFiles) {
|
|
57
59
|
if (existing.patchFiles[patchKey]) {
|
|
58
|
-
console.warn(
|
|
60
|
+
console.warn(
|
|
61
|
+
`Warning: Overwriting One built-in patch with user patch`,
|
|
62
|
+
key,
|
|
63
|
+
patchKey
|
|
64
|
+
)
|
|
59
65
|
}
|
|
60
66
|
existing.patchFiles[patchKey] = extraPatchFiles[patchKey]
|
|
61
67
|
}
|
|
@@ -155,7 +161,9 @@ export async function applyDependencyPatches(
|
|
|
155
161
|
continue
|
|
156
162
|
}
|
|
157
163
|
|
|
158
|
-
const filesToApply = file.includes('*')
|
|
164
|
+
const filesToApply = file.includes('*')
|
|
165
|
+
? globDir(nodeModuleDir, file)
|
|
166
|
+
: [file]
|
|
159
167
|
|
|
160
168
|
await Promise.all(
|
|
161
169
|
filesToApply.map(async (relativePath) => {
|
|
@@ -188,7 +196,8 @@ export async function applyDependencyPatches(
|
|
|
188
196
|
const possibleOrigContents = contentsIn
|
|
189
197
|
// update contentsIn so the next patch gets the new value if it runs multiple
|
|
190
198
|
contentsIn = contents
|
|
191
|
-
const alreadyPatchedPreviouslyInCurrentRun =
|
|
199
|
+
const alreadyPatchedPreviouslyInCurrentRun =
|
|
200
|
+
pathsBeingPatched.has(fullPath)
|
|
192
201
|
pathsBeingPatched.add(fullPath)
|
|
193
202
|
await Promise.all(
|
|
194
203
|
[
|
|
@@ -196,7 +205,10 @@ export async function applyDependencyPatches(
|
|
|
196
205
|
!getIsAlreadyPatched(
|
|
197
206
|
fullPath
|
|
198
207
|
) /* an ogfile must already be there, no need to write */ &&
|
|
199
|
-
atomicWriteFile(
|
|
208
|
+
atomicWriteFile(
|
|
209
|
+
getOgFilePath(fullPath),
|
|
210
|
+
possibleOrigContents
|
|
211
|
+
),
|
|
200
212
|
atomicWriteFile(fullPath, contents),
|
|
201
213
|
].filter((p) => !!p)
|
|
202
214
|
)
|
|
@@ -207,7 +219,9 @@ export async function applyDependencyPatches(
|
|
|
207
219
|
}
|
|
208
220
|
|
|
209
221
|
if (process.env.DEBUG) {
|
|
210
|
-
console.info(
|
|
222
|
+
console.info(
|
|
223
|
+
` - Applied patch to ${patch.module}: ${relativePath}`
|
|
224
|
+
)
|
|
211
225
|
}
|
|
212
226
|
}
|
|
213
227
|
|
|
@@ -140,7 +140,7 @@ export async function scanDepsToOptimize(
|
|
|
140
140
|
const currentRoot = path.dirname(packageJsonPath)
|
|
141
141
|
|
|
142
142
|
const pkgJson = pkgJsonContent || (await readPackageJsonSafe(packageJsonPath))
|
|
143
|
-
const deps =
|
|
143
|
+
const deps = Object.keys(pkgJson.dependencies || {})
|
|
144
144
|
|
|
145
145
|
let hasReanimated = !!pkgJson.dependencies?.['react-native-reanimated']
|
|
146
146
|
|
|
@@ -187,7 +187,9 @@ export async function scanDepsToOptimize(
|
|
|
187
187
|
const shouldPreBundle =
|
|
188
188
|
subDeps.prebundleDeps.length >
|
|
189
189
|
0 /* If this dep is depending on other deps that need pre-bundling, then also pre-bundle this dep */ ||
|
|
190
|
-
INCLUDE_LIST_SET.has(
|
|
190
|
+
INCLUDE_LIST_SET.has(
|
|
191
|
+
dep
|
|
192
|
+
) /* If this dep is in the include list, then pre-bundle it */ ||
|
|
191
193
|
hasRequiredDep(depPkgJson, 'react') ||
|
|
192
194
|
hasRequiredDep(depPkgJson, 'react-native') ||
|
|
193
195
|
hasRequiredDep(depPkgJson, 'expo-modules-core') ||
|
|
@@ -261,7 +263,8 @@ export async function scanDepsToOptimize(
|
|
|
261
263
|
}
|
|
262
264
|
})()
|
|
263
265
|
|
|
264
|
-
const mainExport =
|
|
266
|
+
const mainExport =
|
|
267
|
+
depPkgJson['main'] || depPkgJson['module'] || definedExports['.']
|
|
265
268
|
|
|
266
269
|
const exports = [...definedExports, ...specialExports].filter(
|
|
267
270
|
(d) => !EXCLUDE_LIST_SET.has(d)
|
|
@@ -308,7 +311,10 @@ export async function scanDepsToOptimize(
|
|
|
308
311
|
// this ensures we actually check using an algorithm similar to node/vite
|
|
309
312
|
// probably can find a better one that matches their more accurately
|
|
310
313
|
async function checkIfExportExists(pathIn: string) {
|
|
311
|
-
const paths = [
|
|
314
|
+
const paths = [
|
|
315
|
+
pathIn,
|
|
316
|
+
...(extname(pathIn) ? [] : [pathIn + '.js', pathIn + sep + 'index.js']),
|
|
317
|
+
]
|
|
312
318
|
for (const path of paths) {
|
|
313
319
|
if (await FSExtra.pathExists(path)) {
|
|
314
320
|
return true
|
|
@@ -354,9 +360,13 @@ export async function findDepPkgJsonPath(dep, dependent) {
|
|
|
354
360
|
* - If the dependency is in `dependencies`, it's a required dependency.
|
|
355
361
|
* - If the dependency is in `peerDependencies` and is not marked as optional, it's a required dependency.
|
|
356
362
|
*/
|
|
357
|
-
function hasRequiredDep(
|
|
363
|
+
function hasRequiredDep(
|
|
364
|
+
pkgJson: Record<string, Record<string, any> | undefined>,
|
|
365
|
+
depName: string
|
|
366
|
+
) {
|
|
358
367
|
return !!(
|
|
359
368
|
pkgJson.dependencies?.[depName] ||
|
|
360
|
-
(pkgJson.peerDependencies?.[depName] &&
|
|
369
|
+
(pkgJson.peerDependencies?.[depName] &&
|
|
370
|
+
!pkgJson.peerDependenciesMeta?.[depName]?.optional)
|
|
361
371
|
)
|
|
362
372
|
}
|
|
@@ -12,7 +12,10 @@ import { isNativeEnvironment } from './environmentUtils'
|
|
|
12
12
|
const getPrebuilds = (cacheDir: string, mode) => ({
|
|
13
13
|
reactJSX: join(cacheDir, `react-jsx-runtime${mode === 'prod' ? '.production' : ''}.js`),
|
|
14
14
|
react: join(cacheDir, `react${mode === 'prod' ? '.production' : ''}.js`),
|
|
15
|
-
reactNativeIos: join(
|
|
15
|
+
reactNativeIos: join(
|
|
16
|
+
cacheDir,
|
|
17
|
+
`react-native${mode === 'prod' ? '.production' : ''}.ios.js`
|
|
18
|
+
),
|
|
16
19
|
reactNativeAndroid: join(
|
|
17
20
|
cacheDir,
|
|
18
21
|
`react-native${mode === 'prod' ? '.production' : ''}.android.js`
|
|
@@ -58,7 +61,10 @@ export async function prebuildReactNativeModules(
|
|
|
58
61
|
const reactPackageJsonContents = await readFile(reactPackageJsonPath, 'utf8')
|
|
59
62
|
const reactPackageJson = JSON.parse(reactPackageJsonContents)
|
|
60
63
|
const reactNativePackageJsonPath = resolvePath('react/package.json')
|
|
61
|
-
const reactNativePackageJsonContents = await readFile(
|
|
64
|
+
const reactNativePackageJsonContents = await readFile(
|
|
65
|
+
reactNativePackageJsonPath,
|
|
66
|
+
'utf8'
|
|
67
|
+
)
|
|
62
68
|
const reactNativePackageJson = JSON.parse(reactNativePackageJsonContents)
|
|
63
69
|
|
|
64
70
|
const reactVersion = reactPackageJson?.version
|
|
@@ -123,7 +129,11 @@ export async function swapPrebuiltReactModules(
|
|
|
123
129
|
let prebuilds = getPrebuilds(cacheDir, internal.mode)
|
|
124
130
|
|
|
125
131
|
let cached: null | Record<
|
|
126
|
-
|
|
132
|
+
| 'react-native'
|
|
133
|
+
| 'react'
|
|
134
|
+
| 'react/jsx-runtime'
|
|
135
|
+
| 'react/jsx-dev-runtime'
|
|
136
|
+
| 'react/jsx-runtime',
|
|
127
137
|
{
|
|
128
138
|
alias: string
|
|
129
139
|
contents: string
|
package/src/utils/utils.ts
CHANGED
|
@@ -10,7 +10,10 @@ export function tryStatSync(file: string): fs.Stats | undefined {
|
|
|
10
10
|
} catch {}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export async function lookupFile(
|
|
13
|
+
export async function lookupFile(
|
|
14
|
+
dir: string,
|
|
15
|
+
fileNames: string[]
|
|
16
|
+
): Promise<string | undefined> {
|
|
14
17
|
while (dir) {
|
|
15
18
|
for (const fileName of fileNames) {
|
|
16
19
|
const fullPath = path.join(dir, fileName)
|
package/src/worker.ts
CHANGED
|
@@ -63,25 +63,28 @@ process.on('exit', () => {
|
|
|
63
63
|
})
|
|
64
64
|
|
|
65
65
|
if (!isMainThread && parentPort) {
|
|
66
|
-
parentPort.on(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
parentPort.on(
|
|
67
|
+
'message',
|
|
68
|
+
async (message: WorkerCommands & { _resolvedConfig: ConfigSubset }) => {
|
|
69
|
+
if (message._resolvedConfig) {
|
|
70
|
+
setResolvedConfig(message._resolvedConfig)
|
|
71
|
+
}
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
switch (message.name) {
|
|
74
|
+
case 'bundle-react-native': {
|
|
75
|
+
const { options, platform } = message.arg
|
|
74
76
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
try {
|
|
78
|
+
loadEnv('development')
|
|
79
|
+
const bundle = await getReactNativeBundle(options, platform, { mode: 'dev' })
|
|
80
|
+
parentPort!.postMessage({ result: bundle })
|
|
81
|
+
} catch (error: any) {
|
|
82
|
+
parentPort!.postMessage({ error: error.message })
|
|
83
|
+
}
|
|
82
84
|
|
|
83
|
-
|
|
85
|
+
break
|
|
86
|
+
}
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
|
-
|
|
89
|
+
)
|
|
87
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBaseVitePlugins.d.ts","sourceRoot":"","sources":["../../src/config/getBaseVitePlugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAQxC,wBAAgB,kBAAkB,IAAI,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"getBaseVitePlugins.d.ts","sourceRoot":"","sources":["../../src/config/getBaseVitePlugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAQxC,wBAAgB,kBAAkB,IAAI,YAAY,EAAE,CAoGnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOptionsFilled.d.ts","sourceRoot":"","sources":["../../src/config/getOptionsFilled.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAOjD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAA;AAIvE,wBAAsB,WAAW,
|
|
1
|
+
{"version":3,"file":"getOptionsFilled.d.ts","sourceRoot":"","sources":["../../src/config/getOptionsFilled.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAOjD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAA;AAIvE,wBAAsB,WAAW,CAC/B,OAAO,EAAE,WAAW,EACpB,EAAE,IAAY,EAAE,GAAE;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAJpC,CAAC;eAMH,CAAC;;;;GAqEF;AAED,wBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA7E5B,CAAC;eAMH,CAAC;;;;SAyEF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getServerOptionsFilled.d.ts","sourceRoot":"","sources":["../../src/config/getServerOptionsFilled.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAEzE,wBAAsB,sBAAsB,CAC1C,aAAa,EAAE,WAAW,CAAC,QAAQ,CAAC,EACpC,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,sBAAsB,CAAC,
|
|
1
|
+
{"version":3,"file":"getServerOptionsFilled.d.ts","sourceRoot":"","sources":["../../src/config/getServerOptionsFilled.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAEzE,wBAAsB,sBAAsB,CAC1C,aAAa,EAAE,WAAW,CAAC,QAAQ,CAAC,EACpC,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,sBAAsB,CAAC,CA0BjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getViteServerConfig.d.ts","sourceRoot":"","sources":["../../src/config/getViteServerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAItE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAM3D;;;GAGG;AACH,wBAAsB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"getViteServerConfig.d.ts","sourceRoot":"","sources":["../../src/config/getViteServerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAItE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAM3D;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,iBAAiB,EACzB,cAAc,CAAC,EAAE,UAAU,uBAiD5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/exports/build.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAcpE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AA2BtD,eAAO,MAAM,KAAK,GAAU,WAAW,WAAW,EAAE,YAAW,SAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/exports/build.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAgB,MAAM,QAAQ,CAAA;AAcpE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AA2BtD,eAAO,MAAM,KAAK,GAAU,WAAW,WAAW,EAAE,YAAW,SAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA6BzE,CAAH;mBAM+B,CAAC;;;;;;;;;;;;EAuRhC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/exports/dev.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAI3C,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG;IACrC,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,GAAG,GAAU,WAAW,UAAU;;;;;;
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/exports/dev.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAI3C,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG;IACrC,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,GAAG,GAAU,WAAW,UAAU;;;;;;EA0I9C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadEnv.d.ts","sourceRoot":"","sources":["../../src/exports/loadEnv.ts"],"names":[],"mappings":"AAOA,KAAK,IAAI,GAAG,aAAa,GAAG,YAAY,GAAG,MAAM,CAAA;AAIjD,wBAAsB,OAAO,
|
|
1
|
+
{"version":3,"file":"loadEnv.d.ts","sourceRoot":"","sources":["../../src/exports/loadEnv.ts"],"names":[],"mappings":"AAOA,KAAK,IAAI,GAAG,aAAa,GAAG,YAAY,GAAG,MAAM,CAAA;AAIjD,wBAAsB,OAAO,CAC3B,IAAI,EAAE,IAAI,EACV,IAAI,SAAgB,EACpB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE;;;;;;;;;;GA0C/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prebuild.d.ts","sourceRoot":"","sources":["../../src/exports/prebuild.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,QAAQ,GAAU,oDAK5B;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,CAAA;IACrC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,IAAI,EAAE,OAAO,CAAA;CACd,
|
|
1
|
+
{"version":3,"file":"prebuild.d.ts","sourceRoot":"","sources":["../../src/exports/prebuild.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,QAAQ,GAAU,oDAK5B;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,CAAA;IACrC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,IAAI,EAAE,OAAO,CAAA;CACd,kBA2LA,CAAA;AAoBD,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,iBAOpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serveStaticAssets.d.ts","sourceRoot":"","sources":["../../src/exports/serveStaticAssets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,wBAAsB,iBAAiB,CAAC,EACtC,OAAO,EACP,IAAI,GACL,EAAE;
|
|
1
|
+
{"version":3,"file":"serveStaticAssets.d.ts","sourceRoot":"","sources":["../../src/exports/serveStaticAssets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,wBAAsB,iBAAiB,CAAC,EACtC,OAAO,EACP,IAAI,GACL,EAAE;IACD,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B,iCAkBA"}
|
package/types/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { clean } from './exports/clean';
|
|
|
8
8
|
export { patch } from './exports/patch';
|
|
9
9
|
export { loadEnv } from './exports/loadEnv';
|
|
10
10
|
export { serveStaticAssets } from './exports/serveStaticAssets';
|
|
11
|
-
export { type VXRNOptionsFilled, getOptionsFilled, fillOptions } from './config/getOptionsFilled';
|
|
11
|
+
export { type VXRNOptionsFilled, getOptionsFilled, fillOptions, } from './config/getOptionsFilled';
|
|
12
12
|
export * from './config/getOptimizeDeps';
|
|
13
13
|
export * from './config/getBaseViteConfigOnly';
|
|
14
14
|
export * from './config/getBaseVitePlugins';
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAE/D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAE/D,OAAO,EACL,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,WAAW,GACZ,MAAM,2BAA2B,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AAEtC,cAAc,qCAAqC,CAAA;AACnD,cAAc,iCAAiC,CAAA;AAE/C,cAAc,SAAS,CAAA;AAEvB,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtInDepPatches.d.ts","sourceRoot":"","sources":["../../src/patches/builtInDepPatches.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAmB,MAAM,kBAAkB,CAAA;AAEjE,eAAO,MAAM,iBAAiB,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"builtInDepPatches.d.ts","sourceRoot":"","sources":["../../src/patches/builtInDepPatches.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAmB,MAAM,kBAAkB,CAAA;AAEjE,eAAO,MAAM,iBAAiB,EAAE,QAAQ,EA6dvC,CAAA"}
|
|
@@ -19,6 +19,6 @@ export declare function getScannedOptimizeDepsConfig(props: FindDepsOptionsByMod
|
|
|
19
19
|
noExternal: string[];
|
|
20
20
|
};
|
|
21
21
|
}>;
|
|
22
|
-
export declare function findDepsToOptimize({ root, mode, exclude, include }: FindDepsOptionsByMode): Promise<ScanDepsResult>;
|
|
22
|
+
export declare function findDepsToOptimize({ root, mode, exclude, include, }: FindDepsOptionsByMode): Promise<ScanDepsResult>;
|
|
23
23
|
export {};
|
|
24
24
|
//# sourceMappingURL=autoDepOptimizePlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autoDepOptimizePlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/autoDepOptimizePlugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,MAAM,CAAA;AAChD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"autoDepOptimizePlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/autoDepOptimizePlugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,MAAM,CAAA;AAChD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAC1D,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,6BAA6B,CAAA;AAQpC,KAAK,eAAe,GAAG,0BAA0B,GAAG;IAClD,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAA;CACjD,CAAA;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAiCpE;AAED,eAAO,MAAM,wBAAwB,GAAI,MAAM,MAAM,WAEpD,CAAA;AAED,KAAK,qBAAqB,GAAG,eAAe,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAE/D,wBAAsB,4BAA4B,CAAC,KAAK,EAAE,qBAAqB;;;;;;;;GAc9E;AAID,wBAAsB,kBAAkB,CAAC,EACvC,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,GACR,EAAE,qBAAqB,2BA2EvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expoManifestRequestHandlerPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/expoManifestRequestHandlerPlugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAIlC,KAAK,sCAAsC,GAAG,EAI7C,CAAA;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,sCAAsC,GAC9C,MAAM,
|
|
1
|
+
{"version":3,"file":"expoManifestRequestHandlerPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/expoManifestRequestHandlerPlugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAIlC,KAAK,sCAAsC,GAAG,EAI7C,CAAA;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,sCAAsC,GAC9C,MAAM,CA0KR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactNativeCommonJsPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/reactNativeCommonJsPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,MAAM,EAAmB,MAAM,MAAM,CAAA;AA8BhE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,UAAwC,CAAA;AAE/D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,UAAU,UAAsD,CAAA;AAE7E,wBAAgB,yBAAyB,CAAC,OAAO,EAAE;IACjD,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,GAAG,OAAO,CAAA;CACxB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"reactNativeCommonJsPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/reactNativeCommonJsPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,MAAM,EAAmB,MAAM,MAAM,CAAA;AA8BhE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,UAAwC,CAAA;AAE/D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,UAAU,UAAsD,CAAA;AAE7E,wBAAgB,yBAAyB,CAAC,OAAO,EAAE;IACjD,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,GAAG,OAAO,CAAA;CACxB,GAAG,MAAM,CAmNT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactNativeDevAssetPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/reactNativeDevAssetPlugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"reactNativeDevAssetPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/reactNativeDevAssetPlugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAA;AAsBlD,KAAK,+BAA+B,GAAG;IACrC,kGAAkG;IAClG,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,2BAA2B;IAC3B,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IACrB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,+BAA+B,GACvC,MAAM,CA0IR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactNativeHMRPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/reactNativeHMRPlugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,cAAc,EAA+B,MAAM,MAAM,CAAA;AAGzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAQnE,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACb,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,GAAG;IAAE,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE;;;;
|
|
1
|
+
{"version":3,"file":"reactNativeHMRPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/reactNativeHMRPlugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,cAAc,EAA+B,MAAM,MAAM,CAAA;AAGzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAQnE,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACb,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,GAAG;IAAE,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE;;;;EA0N7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildBundle.d.ts","sourceRoot":"","sources":["../../../src/rn-commands/bundle/buildBundle.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,OAAO,CAAA;IACnB,gBAAgB,EAAE,OAAO,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAA;IAC3B,GAAG,EAAE,OAAO,CAAA;IACZ,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,wBAAwB,EAAE,OAAO,CAAA;IACjC,OAAO,EAAE,OAAO,CAAA;IAChB,wBAAwB,EAAE,MAAM,CAAA;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAC/B,CAAA;AAED,wBAAsB,WAAW,CAC/B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EACpB,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,iBAAiB,EACvB,UAAU,GAAE,GAAU,GACrB,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"buildBundle.d.ts","sourceRoot":"","sources":["../../../src/rn-commands/bundle/buildBundle.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,OAAO,CAAA;IACnB,gBAAgB,EAAE,OAAO,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAA;IAC3B,GAAG,EAAE,OAAO,CAAA;IACZ,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,wBAAwB,EAAE,OAAO,CAAA;IACjC,OAAO,EAAE,OAAO,CAAA;IAChB,wBAAwB,EAAE,MAAM,CAAA;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAC/B,CAAA;AAED,wBAAsB,WAAW,CAC/B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EACpB,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,iBAAiB,EACvB,UAAU,GAAE,GAAU,GACrB,OAAO,CAAC,IAAI,CAAC,CA0Ff"}
|