@expo/cli 1.0.0-canary-20250219-4a5dade → 1.0.0-canary-20250303-4dba60e
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/build/bin/cli +1 -1
- package/build/metro-require/require.js +11 -11
- package/build/src/customize/generate.js +1 -4
- package/build/src/customize/generate.js.map +1 -1
- package/build/src/export/exportDomComponents.js +17 -4
- package/build/src/export/exportDomComponents.js.map +1 -1
- package/build/src/export/exportHermes.js +21 -21
- package/build/src/export/exportHermes.js.map +1 -1
- package/build/src/export/publicFolder.js +1 -3
- package/build/src/export/publicFolder.js.map +1 -1
- package/build/src/prebuild/renameTemplateAppName.js +9 -9
- package/build/src/prebuild/renameTemplateAppName.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/UsbmuxdClient.js +2 -1
- package/build/src/run/ios/appleDevice/client/UsbmuxdClient.js.map +1 -1
- package/build/src/start/server/metro/createServerRouteMiddleware.js +1 -1
- package/build/src/start/server/metro/createServerRouteMiddleware.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +10 -9
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +4 -0
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js +17 -20
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js.map +1 -1
- package/build/src/start/server/type-generation/routes.js +8 -8
- package/build/src/start/server/type-generation/routes.js.map +1 -1
- package/build/src/utils/dir.js +32 -7
- package/build/src/utils/dir.js.map +1 -1
- package/build/src/utils/multipartMixed.js +54 -0
- package/build/src/utils/multipartMixed.js.map +1 -0
- package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
- package/build/src/utils/telemetry/utils/context.js +1 -1
- package/package.json +16 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/run/ios/appleDevice/client/UsbmuxdClient.ts"],"sourcesContent":["/**\n * Copyright (c) 2021 Expo, Inc.\n * Copyright (c) 2018 Drifty Co.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport plist from '@expo/plist';\nimport Debug from 'debug';\nimport { Socket, connect } from 'net';\n\nimport { ResponseError, ServiceClient } from './ServiceClient';\nimport { CommandError } from '../../../../utils/errors';\nimport { parsePlistBuffer } from '../../../../utils/plist';\nimport { UsbmuxProtocolClient } from '../protocol/UsbmuxProtocol';\n\nconst debug = Debug('expo:apple-device:client:usbmuxd');\n\nexport interface UsbmuxdDeviceProperties {\n /** @example 'USB' */\n ConnectionType: 'USB' | 'Network';\n /** @example 7 */\n DeviceID: number;\n /** @example 339738624 */\n LocationID?: number;\n /** @example '00008101-001964A22629003A' */\n SerialNumber: string;\n /**\n * Only available for USB connection.\n * @example 480000000\n */\n ConnectionSpeed?: number;\n /**\n * Only available for USB connection.\n * @example 4776\n */\n ProductID?: number;\n /**\n * Only available for USB connection.\n * @example '00008101-001964A22629003A'\n */\n UDID?: string;\n /**\n * Only available for USB connection.\n * @example '00008101001964A22629003A'\n */\n USBSerialNumber?: string;\n /**\n * Only available for Network connection.\n * @example '08:c7:29:05:f2:30@fe80::ac7:29ff:fe05:f230-supportsRP._apple-mobdev2._tcp.local.'\n */\n EscapedFullServiceName?: string;\n /**\n * Only available for Network connection.\n * @example 5\n */\n InterfaceIndex?: number;\n /**\n * Only available for Network connection.\n */\n NetworkAddress?: Buffer;\n}\n\nexport interface UsbmuxdDevice {\n /** @example 7 */\n DeviceID: number;\n MessageType: 'Attached'; // TODO: what else?\n Properties: UsbmuxdDeviceProperties;\n}\n\nexport interface UsbmuxdConnectResponse {\n MessageType: 'Result';\n Number: number;\n}\n\nexport interface UsbmuxdDeviceResponse {\n DeviceList: UsbmuxdDevice[];\n}\n\nexport interface UsbmuxdPairRecordResponse {\n PairRecordData: Buffer;\n}\n\nexport interface UsbmuxdPairRecord {\n DeviceCertificate: Buffer;\n EscrowBag: Buffer;\n HostCertificate: Buffer;\n HostID: string;\n HostPrivateKey: Buffer;\n RootCertificate: Buffer;\n RootPrivateKey: Buffer;\n SystemBUID: string;\n WiFiMACAddress: string;\n}\n\nfunction isUsbmuxdConnectResponse(resp: any): resp is UsbmuxdConnectResponse {\n return resp.MessageType === 'Result' && resp.Number !== undefined;\n}\n\nfunction isUsbmuxdDeviceResponse(resp: any): resp is UsbmuxdDeviceResponse {\n return resp.DeviceList !== undefined;\n}\n\nfunction isUsbmuxdPairRecordResponse(resp: any): resp is UsbmuxdPairRecordResponse {\n return resp.PairRecordData !== undefined;\n}\n\nexport class UsbmuxdClient extends ServiceClient<UsbmuxProtocolClient> {\n constructor(public socket: Socket) {\n super(socket, new UsbmuxProtocolClient(socket));\n }\n\n static connectUsbmuxdSocket(): Socket {\n debug('connectUsbmuxdSocket');\n if (process.platform === 'win32') {\n return connect({ port: 27015, host: 'localhost' });\n } else {\n return connect({ path: '/var/run/usbmuxd' });\n }\n }\n\n async connect(device: Pick<UsbmuxdDevice, 'DeviceID'>, port: number): Promise<Socket> {\n debug(`connect: ${device.DeviceID} on port ${port}`);\n debug(`connect:device: %O`, device);\n\n const response = await this.protocolClient.sendMessage({\n messageType: 'Connect',\n extraFields: {\n DeviceID: device.DeviceID,\n PortNumber: htons(port),\n },\n });\n debug(`connect:device:response: %O`, response);\n\n if (isUsbmuxdConnectResponse(response) && response.Number === 0) {\n return this.protocolClient.socket;\n } else {\n throw new ResponseError(\n `There was an error connecting to the USB connected device (id: ${device.DeviceID}, port: ${port})`,\n response\n );\n }\n }\n\n async getDevices(): Promise<UsbmuxdDevice[]> {\n debug('getDevices');\n\n const resp = await this.protocolClient.sendMessage({\n messageType: 'ListDevices',\n });\n\n if (isUsbmuxdDeviceResponse(resp)) {\n return resp.DeviceList;\n } else {\n throw new ResponseError('Invalid response from getDevices', resp);\n }\n }\n\n async getDevice(udid?: string): Promise<UsbmuxdDevice> {\n debug(`getDevice ${udid ? 'udid: ' + udid : ''}`);\n const devices = await this.getDevices();\n\n if (!devices.length) {\n throw new CommandError('APPLE_DEVICE_USBMUXD', 'No devices found');\n }\n\n if (!udid) {\n return devices[0];\n }\n\n for (const device of devices) {\n if (device.Properties && device.Properties.SerialNumber === udid) {\n return device;\n }\n }\n\n throw new CommandError('APPLE_DEVICE_USBMUXD', `No device found (udid: ${udid})`);\n }\n\n async readPairRecord(udid: string): Promise<UsbmuxdPairRecord> {\n debug(`readPairRecord: ${udid}`);\n\n const resp = await this.protocolClient.sendMessage({\n messageType: 'ReadPairRecord',\n extraFields: { PairRecordID: udid },\n });\n\n if (isUsbmuxdPairRecordResponse(resp)) {\n // the pair record can be created as a binary plist\n const BPLIST_MAGIC = Buffer.from('bplist00');\n if (BPLIST_MAGIC.compare(resp.PairRecordData, 0, 8) === 0) {\n debug('Binary plist pair record detected.');\n return parsePlistBuffer(resp.PairRecordData)[0];\n } else {\n // TODO: use parsePlistBuffer\n return plist.parse(resp.PairRecordData.toString()) as any; // TODO: type guard\n }\n } else {\n throw new ResponseError(\n `There was an error reading pair record for device (udid: ${udid})`,\n resp\n );\n }\n }\n}\n\nfunction htons(n: number): number {\n return ((n & 0xff) << 8) | ((n >> 8) & 0xff);\n}\n"],"names":["UsbmuxdClient","debug","Debug","isUsbmuxdConnectResponse","resp","MessageType","Number","undefined","isUsbmuxdDeviceResponse","DeviceList","isUsbmuxdPairRecordResponse","PairRecordData","ServiceClient","constructor","socket","UsbmuxProtocolClient","connectUsbmuxdSocket","process","platform","connect","port","host","path","device","DeviceID","response","protocolClient","sendMessage","messageType","extraFields","PortNumber","htons","ResponseError","getDevices","getDevice","udid","devices","length","CommandError","Properties","SerialNumber","readPairRecord","PairRecordID","BPLIST_MAGIC","Buffer","from","compare","parsePlistBuffer","plist","parse","toString","n"],"mappings":"AAAA;;;;;;CAMC,GACD;;;;+BAoGaA,eAAa;;aAAbA,aAAa;;;8DApGR,aAAa;;;;;;;8DACb,OAAO;;;;;;;yBAC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ACO,cAAc,CAACuC,QAAQ,EAAE,CAAC,CAAQ,CAAC,mBAAmB;YAChF,CAAC;QACH,OAAO;YACL,MAAM,IAAIlB,cAAa,cAAA,CACrB,CAAC,yDAAyD,EAAEG,IAAI,CAAC,CAAC,CAAC,EACnE/B,IAAI,CACL,CAAC;QACJ,CAAC;IACH;CACD;AAED,SAAS2B,KAAK,CAACoB,CAAS,EAAU;IAChC,OAAO,AAAC,CAACA,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAK,AAACA,CAAC,IAAI,CAAC,GAAI,IAAI,AAAC,CAAC;AAC/C,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/run/ios/appleDevice/client/UsbmuxdClient.ts"],"sourcesContent":["/**\n * Copyright (c) 2021 Expo, Inc.\n * Copyright (c) 2018 Drifty Co.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport plist from '@expo/plist';\nimport Debug from 'debug';\nimport { Socket, connect } from 'net';\n\nimport { ResponseError, ServiceClient } from './ServiceClient';\nimport { CommandError } from '../../../../utils/errors';\nimport { parsePlistBuffer } from '../../../../utils/plist';\nimport { UsbmuxProtocolClient } from '../protocol/UsbmuxProtocol';\n\nconst debug = Debug('expo:apple-device:client:usbmuxd');\n\nexport interface UsbmuxdDeviceProperties {\n /** @example 'USB' */\n ConnectionType: 'USB' | 'Network';\n /** @example 7 */\n DeviceID: number;\n /** @example 339738624 */\n LocationID?: number;\n /** @example '00008101-001964A22629003A' */\n SerialNumber: string;\n /**\n * Only available for USB connection.\n * @example 480000000\n */\n ConnectionSpeed?: number;\n /**\n * Only available for USB connection.\n * @example 4776\n */\n ProductID?: number;\n /**\n * Only available for USB connection.\n * @example '00008101-001964A22629003A'\n */\n UDID?: string;\n /**\n * Only available for USB connection.\n * @example '00008101001964A22629003A'\n */\n USBSerialNumber?: string;\n /**\n * Only available for Network connection.\n * @example '08:c7:29:05:f2:30@fe80::ac7:29ff:fe05:f230-supportsRP._apple-mobdev2._tcp.local.'\n */\n EscapedFullServiceName?: string;\n /**\n * Only available for Network connection.\n * @example 5\n */\n InterfaceIndex?: number;\n /**\n * Only available for Network connection.\n */\n NetworkAddress?: Buffer;\n}\n\nexport interface UsbmuxdDevice {\n /** @example 7 */\n DeviceID: number;\n MessageType: 'Attached'; // TODO: what else?\n Properties: UsbmuxdDeviceProperties;\n}\n\nexport interface UsbmuxdConnectResponse {\n MessageType: 'Result';\n Number: number;\n}\n\nexport interface UsbmuxdDeviceResponse {\n DeviceList: UsbmuxdDevice[];\n}\n\nexport interface UsbmuxdPairRecordResponse {\n PairRecordData: Buffer;\n}\n\nexport interface UsbmuxdPairRecord {\n DeviceCertificate: Buffer;\n EscrowBag: Buffer;\n HostCertificate: Buffer;\n HostID: string;\n HostPrivateKey: Buffer;\n RootCertificate: Buffer;\n RootPrivateKey: Buffer;\n SystemBUID: string;\n WiFiMACAddress: string;\n}\n\nfunction isUsbmuxdConnectResponse(resp: any): resp is UsbmuxdConnectResponse {\n return resp.MessageType === 'Result' && resp.Number !== undefined;\n}\n\nfunction isUsbmuxdDeviceResponse(resp: any): resp is UsbmuxdDeviceResponse {\n return resp.DeviceList !== undefined;\n}\n\nfunction isUsbmuxdPairRecordResponse(resp: any): resp is UsbmuxdPairRecordResponse {\n return resp.PairRecordData !== undefined;\n}\n\nexport class UsbmuxdClient extends ServiceClient<UsbmuxProtocolClient> {\n constructor(public socket: Socket) {\n super(socket, new UsbmuxProtocolClient(socket));\n }\n\n static connectUsbmuxdSocket(): Socket {\n debug('connectUsbmuxdSocket');\n if (process.platform === 'win32') {\n return connect({ port: 27015, host: 'localhost' });\n } else {\n return connect({ path: '/var/run/usbmuxd' });\n }\n }\n\n async connect(device: Pick<UsbmuxdDevice, 'DeviceID'>, port: number): Promise<Socket> {\n debug(`connect: ${device.DeviceID} on port ${port}`);\n debug(`connect:device: %O`, device);\n\n const response = await this.protocolClient.sendMessage({\n messageType: 'Connect',\n extraFields: {\n DeviceID: device.DeviceID,\n PortNumber: htons(port),\n },\n });\n debug(`connect:device:response: %O`, response);\n\n if (isUsbmuxdConnectResponse(response) && response.Number === 0) {\n return this.protocolClient.socket;\n } else {\n throw new ResponseError(\n `There was an error connecting to the USB connected device (id: ${device.DeviceID}, port: ${port})`,\n response\n );\n }\n }\n\n async getDevices(): Promise<UsbmuxdDevice[]> {\n debug('getDevices');\n\n const resp = await this.protocolClient.sendMessage({\n messageType: 'ListDevices',\n });\n\n if (isUsbmuxdDeviceResponse(resp)) {\n return resp.DeviceList;\n } else {\n throw new ResponseError('Invalid response from getDevices', resp);\n }\n }\n\n async getDevice(udid?: string): Promise<UsbmuxdDevice> {\n debug(`getDevice ${udid ? 'udid: ' + udid : ''}`);\n const devices = await this.getDevices();\n\n if (!devices.length) {\n throw new CommandError('APPLE_DEVICE_USBMUXD', 'No devices found');\n }\n\n if (!udid) {\n return devices[0];\n }\n\n for (const device of devices) {\n if (device.Properties && device.Properties.SerialNumber === udid) {\n return device;\n }\n }\n\n throw new CommandError('APPLE_DEVICE_USBMUXD', `No device found (udid: ${udid})`);\n }\n\n async readPairRecord(udid: string): Promise<UsbmuxdPairRecord> {\n debug(`readPairRecord: ${udid}`);\n\n const resp = await this.protocolClient.sendMessage({\n messageType: 'ReadPairRecord',\n extraFields: { PairRecordID: udid },\n });\n\n if (isUsbmuxdPairRecordResponse(resp)) {\n // the pair record can be created as a binary plist\n const BPLIST_MAGIC = Buffer.from('bplist00');\n if (BPLIST_MAGIC.compare(resp.PairRecordData, 0, 8) === 0) {\n debug('Binary plist pair record detected.');\n const pairRecords = parsePlistBuffer(resp.PairRecordData);\n return Array.isArray(pairRecords) ? pairRecords[0] : pairRecords;\n } else {\n // TODO: use parsePlistBuffer\n return plist.parse(resp.PairRecordData.toString()) as any; // TODO: type guard\n }\n } else {\n throw new ResponseError(\n `There was an error reading pair record for device (udid: ${udid})`,\n resp\n );\n }\n }\n}\n\nfunction htons(n: number): number {\n return ((n & 0xff) << 8) | ((n >> 8) & 0xff);\n}\n"],"names":["UsbmuxdClient","debug","Debug","isUsbmuxdConnectResponse","resp","MessageType","Number","undefined","isUsbmuxdDeviceResponse","DeviceList","isUsbmuxdPairRecordResponse","PairRecordData","ServiceClient","constructor","socket","UsbmuxProtocolClient","connectUsbmuxdSocket","process","platform","connect","port","host","path","device","DeviceID","response","protocolClient","sendMessage","messageType","extraFields","PortNumber","htons","ResponseError","getDevices","getDevice","udid","devices","length","CommandError","Properties","SerialNumber","readPairRecord","PairRecordID","BPLIST_MAGIC","Buffer","from","compare","pairRecords","parsePlistBuffer","Array","isArray","plist","parse","toString","n"],"mappings":"AAAA;;;;;;CAMC,GACD;;;;+BAoGaA,eAAa;;aAAbA,aAAa;;;8DApGR,aAAa;;;;;;;8DACb,OAAO;;;;;;;yBACO,KAAK;;;;;;+BAEQ,iBAAiB;wBACjC,0BAA0B;wBACtB,yBAAyB;gCACrB,4BAA4B;;;;;;AAEjE,MAAMC,KAAK,GAAGC,IAAAA,MAAK,EAAA,QAAA,EAAC,kCAAkC,CAAC,AAAC;AA+ExD,SAASC,wBAAwB,CAACC,IAAS,EAAkC;IAC3E,OAAOA,IAAI,CAACC,WAAW,KAAK,QAAQ,IAAID,IAAI,CAACE,MAAM,KAAKC,SAAS,CAAC;AACpE,CAAC;AAED,SAASC,uBAAuB,CAACJ,IAAS,EAAiC;IACzE,OAAOA,IAAI,CAACK,UAAU,KAAKF,SAAS,CAAC;AACvC,CAAC;AAED,SAASG,2BAA2B,CAACN,IAAS,EAAqC;IACjF,OAAOA,IAAI,CAACO,cAAc,KAAKJ,SAAS,CAAC;AAC3C,CAAC;AAEM,MAAMP,aAAa,SAASY,cAAa,cAAA;IAC9CC,YAAmBC,MAAc,CAAE;QACjC,KAAK,CAACA,MAAM,EAAE,IAAIC,eAAoB,qBAAA,CAACD,MAAM,CAAC,CAAC,CAAC;QAD/BA,cAAAA,MAAc,CAAA;IAEjC;WAEOE,oBAAoB,GAAW;QACpCf,KAAK,CAAC,sBAAsB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aAAE;SACpC,CAAC,AAAC;QAEH,IAAIzB,2BAA2B,CAACN,IAAI,CAAC,EAAE;YACrC,mDAAmD;YACnD,MAAMuC,YAAY,GAAGC,MAAM,CAACC,IAAI,CAAC,UAAU,CAAC,AAAC;YAC7C,IAAIF,YAAY,CAACG,OAAO,CAAC1C,IAAI,CAACO,cAAc,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE;gBACzDV,KAAK,CAAC,oCAAoC,CAAC,CAAC;gBAC5C,MAAM8C,WAAW,GAAGC,IAAAA,OAAgB,iBAAA,EAAC5C,IAAI,CAACO,cAAc,CAAC,AAAC;gBAC1D,OAAOsC,KAAK,CAACC,OAAO,CAACH,WAAW,CAAC,GAAGA,WAAW,CAAC,CAAC,CAAC,GAAGA,WAAW,CAAC;YACnE,OAAO;gBACL,6BAA6B;gBAC7B,OAAOI,MAAK,EAAA,QAAA,CAACC,KAAK,CAAChD,IAAI,CAACO,cAAc,CAAC0C,QAAQ,EAAE,CAAC,CAAQ,CAAC,mBAAmB;YAChF,CAAC;QACH,OAAO;YACL,MAAM,IAAIrB,cAAa,cAAA,CACrB,CAAC,yDAAyD,EAAEG,IAAI,CAAC,CAAC,CAAC,EACnE/B,IAAI,CACL,CAAC;QACJ,CAAC;IACH;CACD;AAED,SAAS2B,KAAK,CAACuB,CAAS,EAAU;IAChC,OAAO,AAAC,CAACA,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAK,AAACA,CAAC,IAAI,CAAC,GAAI,IAAI,AAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -45,7 +45,7 @@ const debug = require("debug")("expo:start:server:metro");
|
|
|
45
45
|
const resolveAsync = (0, _util().promisify)(_resolve().default);
|
|
46
46
|
function createRouteHandlerMiddleware(projectRoot, options) {
|
|
47
47
|
if (!_resolveFrom().default.silent(projectRoot, "expo-router")) {
|
|
48
|
-
throw new _errors.CommandError(
|
|
48
|
+
throw new _errors.CommandError(`static and server rendering requires the expo-router package to be installed in your project. Either install the expo-router package or change 'web.output' to 'static' in your app.json.`);
|
|
49
49
|
}
|
|
50
50
|
const { createRequestHandler } = require("@expo/server/build/vendor/http");
|
|
51
51
|
return createRequestHandler({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/metro/createServerRouteMiddleware.ts"],"sourcesContent":["/**\n * Copyright © 2022 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport type { ProjectConfig } from '@expo/config';\nimport resolve from 'resolve';\nimport resolveFrom from 'resolve-from';\nimport { promisify } from 'util';\n\nimport { fetchManifest } from './fetchRouterManifest';\nimport { getErrorOverlayHtmlAsync, logMetroError } from './metroErrorInterface';\nimport { warnInvalidWebOutput } from './router';\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')('expo:start:server:metro') as typeof console.log;\n\nconst resolveAsync = promisify(resolve) as any as (\n id: string,\n opts: resolve.AsyncOpts\n) => Promise<string | null>;\n\nexport function createRouteHandlerMiddleware(\n projectRoot: string,\n options: {\n appDir: string;\n routerRoot: string;\n getStaticPageAsync: (pathname: string) => Promise<{ content: string }>;\n bundleApiRoute: (\n functionFilePath: string\n ) => Promise<null | Record<string, Function> | Response>;\n config: ProjectConfig;\n } & import('expo-router/build/routes-manifest').Options\n) {\n if (!resolveFrom.silent(projectRoot, 'expo-router')) {\n throw new CommandError(\n
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/metro/createServerRouteMiddleware.ts"],"sourcesContent":["/**\n * Copyright © 2022 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport type { ProjectConfig } from '@expo/config';\nimport resolve from 'resolve';\nimport resolveFrom from 'resolve-from';\nimport { promisify } from 'util';\n\nimport { fetchManifest } from './fetchRouterManifest';\nimport { getErrorOverlayHtmlAsync, logMetroError } from './metroErrorInterface';\nimport { warnInvalidWebOutput } from './router';\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')('expo:start:server:metro') as typeof console.log;\n\nconst resolveAsync = promisify(resolve) as any as (\n id: string,\n opts: resolve.AsyncOpts\n) => Promise<string | null>;\n\nexport function createRouteHandlerMiddleware(\n projectRoot: string,\n options: {\n appDir: string;\n routerRoot: string;\n getStaticPageAsync: (pathname: string) => Promise<{ content: string }>;\n bundleApiRoute: (\n functionFilePath: string\n ) => Promise<null | Record<string, Function> | Response>;\n config: ProjectConfig;\n } & import('expo-router/build/routes-manifest').Options\n) {\n if (!resolveFrom.silent(projectRoot, 'expo-router')) {\n throw new CommandError(\n `static and server rendering requires the expo-router package to be installed in your project. Either install the expo-router package or change 'web.output' to 'static' in your app.json.`\n );\n }\n\n const { createRequestHandler } =\n require('@expo/server/build/vendor/http') as typeof import('@expo/server/build/vendor/http');\n\n return createRequestHandler(\n { build: '' },\n {\n async getRoutesManifest() {\n const manifest = await fetchManifest<RegExp>(projectRoot, options);\n debug('manifest', manifest);\n // NOTE: no app dir if null\n // TODO: Redirect to 404 page\n return (\n manifest ?? {\n // Support the onboarding screen if there's no manifest\n htmlRoutes: [\n {\n file: 'index.js',\n page: '/index',\n routeKeys: {},\n namedRegex: /^\\/(?:index)?\\/?$/i,\n },\n ],\n apiRoutes: [],\n notFoundRoutes: [],\n }\n );\n },\n async getHtml(request) {\n try {\n const { content } = await options.getStaticPageAsync(request.url);\n return content;\n } catch (error: any) {\n // Forward the Metro server response as-is. It won't be pretty, but at least it will be accurate.\n\n try {\n return new Response(\n await getErrorOverlayHtmlAsync({\n error,\n projectRoot,\n routerRoot: options.routerRoot,\n }),\n {\n status: 500,\n headers: {\n 'Content-Type': 'text/html',\n },\n }\n );\n } catch (staticError: any) {\n debug('Failed to render static error overlay:', staticError);\n // Fallback error for when Expo Router is misconfigured in the project.\n return new Response(\n '<span><h3>Internal Error:</h3><b>Project is not setup correctly for static rendering (check terminal for more info):</b><br/>' +\n error.message +\n '<br/><br/>' +\n staticError.message +\n '</span>',\n {\n status: 500,\n headers: {\n 'Content-Type': 'text/html',\n },\n }\n );\n }\n }\n },\n logApiRouteExecutionError(error) {\n logMetroError(projectRoot, { error });\n },\n async handleApiRouteError(error) {\n const htmlServerError = await getErrorOverlayHtmlAsync({\n error,\n projectRoot,\n routerRoot: options.routerRoot!,\n });\n\n return new Response(htmlServerError, {\n status: 500,\n headers: {\n 'Content-Type': 'text/html',\n },\n });\n },\n async getApiRoute(route) {\n const { exp } = options.config;\n if (exp.web?.output !== 'server') {\n warnInvalidWebOutput();\n }\n\n const resolvedFunctionPath = await resolveAsync(route.file, {\n extensions: ['.js', '.jsx', '.ts', '.tsx'],\n basedir: options.appDir,\n })!;\n\n try {\n debug(`Bundling middleware at: ${resolvedFunctionPath}`);\n return await options.bundleApiRoute(resolvedFunctionPath!);\n } catch (error: any) {\n return new Response(\n 'Failed to load API Route: ' + resolvedFunctionPath + '\\n\\n' + error.message,\n {\n status: 500,\n headers: {\n 'Content-Type': 'text/html',\n },\n }\n );\n }\n },\n }\n );\n}\n"],"names":["createRouteHandlerMiddleware","debug","require","resolveAsync","promisify","resolve","projectRoot","options","resolveFrom","silent","CommandError","createRequestHandler","build","getRoutesManifest","manifest","fetchManifest","htmlRoutes","file","page","routeKeys","namedRegex","apiRoutes","notFoundRoutes","getHtml","request","content","getStaticPageAsync","url","error","Response","getErrorOverlayHtmlAsync","routerRoot","status","headers","staticError","message","logApiRouteExecutionError","logMetroError","handleApiRouteError","htmlServerError","getApiRoute","route","exp","config","web","output","warnInvalidWebOutput","resolvedFunctionPath","extensions","basedir","appDir","bundleApiRoute"],"mappings":"AAAA;;;;;CAKC,GAED;;;;+BAiBgBA,8BAA4B;;aAA5BA,4BAA4B;;;8DAhBxB,SAAS;;;;;;;8DACL,cAAc;;;;;;;yBACZ,MAAM;;;;;;qCAEF,uBAAuB;qCACG,uBAAuB;wBAC1C,UAAU;wBAClB,uBAAuB;;;;;;AAEpD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CA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GAAfF,KAAAA,CAAe,GAAfA,GAAO,CAAEG,MAAM,CAAA,KAAK,QAAQ,EAAE;gBAChCC,IAAAA,OAAoB,qBAAA,GAAE,CAAC;YACzB,CAAC;YAED,MAAMC,oBAAoB,GAAG,MAAM5C,YAAY,CAACsC,KAAK,CAACxB,IAAI,EAAE;gBAC1D+B,UAAU,EAAE;oBAAC,KAAK;oBAAE,MAAM;oBAAE,KAAK;oBAAE,MAAM;iBAAC;gBAC1CC,OAAO,EAAE1C,OAAO,CAAC2C,MAAM;aACxB,CAAC,AAAC,AAAC;YAEJ,IAAI;gBACFjD,KAAK,CAAC,CAAC,wBAAwB,EAAE8C,oBAAoB,CAAC,CAAC,CAAC,CAAC;gBACzD,OAAO,MAAMxC,OAAO,CAAC4C,cAAc,CAACJ,oBAAoB,CAAE,CAAC;YAC7D,EAAE,OAAOnB,KAAK,EAAO;gBACnB,OAAO,IAAIC,QAAQ,CACjB,4BAA4B,GAAGkB,oBAAoB,GAAG,MAAM,GAAGnB,KAAK,CAACO,OAAO,EAC5E;oBACEH,MAAM,EAAE,GAAG;oBACXC,OAAO,EAAE;wBACP,cAAc,EAAE,WAAW;qBAC5B;iBACF,CACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -41,13 +41,6 @@ function _chalk() {
|
|
|
41
41
|
};
|
|
42
42
|
return data;
|
|
43
43
|
}
|
|
44
|
-
function _hmrJSBundle() {
|
|
45
|
-
const data = /*#__PURE__*/ _interopRequireDefault(require("metro/src/DeltaBundler/Serializers/hmrJSBundle"));
|
|
46
|
-
_hmrJSBundle = function() {
|
|
47
|
-
return data;
|
|
48
|
-
};
|
|
49
|
-
return data;
|
|
50
|
-
}
|
|
51
44
|
function _revisionNotFoundError() {
|
|
52
45
|
const data = /*#__PURE__*/ _interopRequireDefault(require("metro/src/IncrementalBundler/RevisionNotFoundError"));
|
|
53
46
|
_revisionNotFoundError = function() {
|
|
@@ -292,7 +285,15 @@ async function instantiateMetroAsync(metroBundler, options, { isExporting , exp
|
|
|
292
285
|
(a, b)=>this._createModuleId(a.path, ctx) - this._createModuleId(b.path, ctx));
|
|
293
286
|
};
|
|
294
287
|
if (hmrServer) {
|
|
295
|
-
|
|
288
|
+
let hmrJSBundle;
|
|
289
|
+
try {
|
|
290
|
+
hmrJSBundle = require("@expo/metro-config/build/serializer/fork/hmrJSBundle").default;
|
|
291
|
+
} catch {
|
|
292
|
+
// Add fallback for monorepo tests up until the fork is merged.
|
|
293
|
+
_log.Log.warn("Failed to load HMR serializer from @expo/metro-config, using fallback version.");
|
|
294
|
+
hmrJSBundle = require("metro/src/DeltaBundler/Serializers/hmrJSBundle");
|
|
295
|
+
}
|
|
296
|
+
// Patch HMR Server to send more info to the `_createModuleId` function for deterministic module IDs and add support for serializing HMR updates the same as all other bundles.
|
|
296
297
|
hmrServer._prepareMessage = async function(group, options, changeEvent) {
|
|
297
298
|
// Fork of https://github.com/facebook/metro/blob/3b3e0aaf725cfa6907bf2c8b5fbc0da352d29efe/packages/metro/src/HmrServer.js#L327-L393
|
|
298
299
|
// with patch for `_createModuleId`.
|
|
@@ -322,7 +323,7 @@ async function instantiateMetroAsync(metroBundler, options, { isExporting , exp
|
|
|
322
323
|
platform: revision.graph.transformOptions.platform,
|
|
323
324
|
environment: (ref = revision.graph.transformOptions.customTransformOptions) == null ? void 0 : ref.environment
|
|
324
325
|
};
|
|
325
|
-
const hmrUpdate = (
|
|
326
|
+
const hmrUpdate = hmrJSBundle(delta, revision.graph, {
|
|
326
327
|
clientUrl: group.clientUrl,
|
|
327
328
|
// NOTE(EvanBacon): This is also the patch
|
|
328
329
|
createModuleId: (moduleId)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/metro/instantiateMetro.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\nimport { getMetroServerRoot } from '@expo/config/paths';\nimport { getDefaultConfig, LoadOptions } from '@expo/metro-config';\nimport chalk from 'chalk';\nimport http from 'http';\nimport type Metro from 'metro';\nimport { ReadOnlyGraph } from 'metro';\nimport Bundler from 'metro/src/Bundler';\nimport hmrJSBundle from 'metro/src/DeltaBundler/Serializers/hmrJSBundle';\nimport type { TransformOptions } from 'metro/src/DeltaBundler/Worker';\nimport MetroHmrServer from 'metro/src/HmrServer';\nimport RevisionNotFoundError from 'metro/src/IncrementalBundler/RevisionNotFoundError';\nimport formatBundlingError from 'metro/src/lib/formatBundlingError';\nimport { loadConfig, resolveConfig, ConfigT } from 'metro-config';\nimport { Terminal } from 'metro-core';\nimport util from 'node:util';\nimport path from 'path';\n\nimport { createDevToolsPluginWebsocketEndpoint } from './DevToolsPluginWebsocketEndpoint';\nimport { MetroBundlerDevServer } from './MetroBundlerDevServer';\nimport { MetroTerminalReporter } from './MetroTerminalReporter';\nimport { attachAtlasAsync } from './debugging/attachAtlas';\nimport { createDebugMiddleware } from './debugging/createDebugMiddleware';\nimport { createMetroMiddleware } from './dev-server/createMetroMiddleware';\nimport { runServer } from './runServer-fork';\nimport { withMetroMultiPlatformAsync } from './withMetroMultiPlatform';\nimport { Log } from '../../../log';\nimport { env } from '../../../utils/env';\nimport { CommandError } from '../../../utils/errors';\nimport { createCorsMiddleware } from '../middleware/CorsMiddleware';\nimport { createJsInspectorMiddleware } from '../middleware/inspector/createJsInspectorMiddleware';\nimport { prependMiddleware } from '../middleware/mutations';\nimport { getPlatformBundlers } from '../platformBundlers';\n\n// From expo/dev-server but with ability to use custom logger.\ntype MessageSocket = {\n broadcast: (method: string, params?: Record<string, any> | undefined) => void;\n};\n\n// Wrap terminal and polyfill console.log so we can log during bundling without breaking the indicator.\nclass LogRespectingTerminal extends Terminal {\n constructor(stream: import('node:net').Socket | import('node:stream').Writable) {\n super(stream);\n\n const sendLog = (...args: any[]) => {\n this._logLines.push(\n // format args like console.log\n util.format(...args)\n );\n this._scheduleUpdate();\n\n // Flush the logs to the terminal immediately so logs at the end of the process are not lost.\n this.flush();\n };\n\n console.log = sendLog;\n console.info = sendLog;\n }\n}\n\n// Share one instance of Terminal for all instances of Metro.\nconst terminal = new LogRespectingTerminal(process.stdout);\n\nexport async function loadMetroConfigAsync(\n projectRoot: string,\n options: LoadOptions,\n {\n exp,\n isExporting,\n getMetroBundler,\n }: { exp: ExpoConfig; isExporting: boolean; getMetroBundler: () => Bundler }\n) {\n let reportEvent: ((event: any) => void) | undefined;\n\n const serverActionsEnabled =\n exp.experiments?.reactServerFunctions ?? env.EXPO_UNSTABLE_SERVER_FUNCTIONS;\n\n if (serverActionsEnabled) {\n process.env.EXPO_UNSTABLE_SERVER_FUNCTIONS = '1';\n }\n\n // NOTE: Enable all the experimental Metro flags when RSC is enabled.\n if (exp.experiments?.reactServerComponentRoutes || serverActionsEnabled) {\n process.env.EXPO_USE_METRO_REQUIRE = '1';\n process.env.EXPO_USE_FAST_RESOLVER = '1';\n }\n\n const serverRoot = getMetroServerRoot(projectRoot);\n const terminalReporter = new MetroTerminalReporter(serverRoot, terminal);\n\n const hasConfig = await resolveConfig(options.config, projectRoot);\n let config: ConfigT = {\n ...(await loadConfig(\n { cwd: projectRoot, projectRoot, ...options },\n // If the project does not have a metro.config.js, then we use the default config.\n hasConfig.isEmpty ? getDefaultConfig(projectRoot) : undefined\n )),\n reporter: {\n update(event: any) {\n terminalReporter.update(event);\n if (reportEvent) {\n reportEvent(event);\n }\n },\n },\n };\n\n // @ts-expect-error: Set the global require cycle ignore patterns for SSR bundles. This won't work with custom global prefixes, but we don't use those.\n globalThis.__requireCycleIgnorePatterns = config.resolver?.requireCycleIgnorePatterns;\n\n if (isExporting) {\n // This token will be used in the asset plugin to ensure the path is correct for writing locally.\n // @ts-expect-error: typed as readonly.\n config.transformer.publicPath = `/assets?export_path=${\n (exp.experiments?.baseUrl ?? '') + '/assets'\n }`;\n } else {\n // @ts-expect-error: typed as readonly\n config.transformer.publicPath = '/assets/?unstable_path=.';\n }\n\n const platformBundlers = getPlatformBundlers(projectRoot, exp);\n\n if (exp.experiments?.reactCompiler) {\n Log.warn(`Experimental React Compiler is enabled.`);\n }\n\n if (env.EXPO_UNSTABLE_TREE_SHAKING && !env.EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH) {\n throw new CommandError(\n 'EXPO_UNSTABLE_TREE_SHAKING requires EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH to be enabled.'\n );\n }\n\n if (env.EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH) {\n Log.warn(`Experimental bundle optimization is enabled.`);\n }\n if (env.EXPO_UNSTABLE_TREE_SHAKING) {\n Log.warn(`Experimental tree shaking is enabled.`);\n }\n\n if (serverActionsEnabled) {\n Log.warn(\n `Experimental React Server Functions are enabled. Production exports are not supported yet.`\n );\n if (!exp.experiments?.reactServerComponentRoutes) {\n Log.warn(\n `- React Server Component routes are NOT enabled. Routes will render in client mode.`\n );\n }\n }\n\n config = await withMetroMultiPlatformAsync(projectRoot, {\n config,\n exp,\n platformBundlers,\n isTsconfigPathsEnabled: exp.experiments?.tsconfigPaths ?? true,\n isFastResolverEnabled: env.EXPO_USE_FAST_RESOLVER,\n isExporting,\n isReactCanaryEnabled:\n (exp.experiments?.reactServerComponentRoutes ||\n serverActionsEnabled ||\n exp.experiments?.reactCanary) ??\n false,\n isNamedRequiresEnabled: env.EXPO_USE_METRO_REQUIRE,\n isReactServerComponentsEnabled: !!exp.experiments?.reactServerComponentRoutes,\n getMetroBundler,\n });\n\n return {\n config,\n setEventReporter: (logger: (event: any) => void) => (reportEvent = logger),\n reporter: terminalReporter,\n };\n}\n\n/** The most generic possible setup for Metro bundler. */\nexport async function instantiateMetroAsync(\n metroBundler: MetroBundlerDevServer,\n options: Omit<LoadOptions, 'logger'>,\n {\n isExporting,\n exp = getConfig(metroBundler.projectRoot, {\n skipSDKVersionRequirement: true,\n }).exp,\n }: { isExporting: boolean; exp?: ExpoConfig }\n): Promise<{\n metro: Metro.Server;\n hmrServer: MetroHmrServer | null;\n server: http.Server;\n middleware: any;\n messageSocket: MessageSocket;\n}> {\n const projectRoot = metroBundler.projectRoot;\n\n const { config: metroConfig, setEventReporter } = await loadMetroConfigAsync(\n projectRoot,\n options,\n {\n exp,\n isExporting,\n getMetroBundler() {\n return metro.getBundler().getBundler();\n },\n }\n );\n\n // Create the core middleware stack for Metro, including websocket listeners\n const { middleware, messagesSocket, eventsSocket, websocketEndpoints } =\n createMetroMiddleware(metroConfig);\n\n if (!isExporting) {\n // Enable correct CORS headers for Expo Router features\n prependMiddleware(middleware, createCorsMiddleware(exp));\n\n // Enable debug middleware for CDP-related debugging\n const { debugMiddleware, debugWebsocketEndpoints } = createDebugMiddleware(metroBundler);\n Object.assign(websocketEndpoints, debugWebsocketEndpoints);\n middleware.use(debugMiddleware);\n middleware.use('/_expo/debugger', createJsInspectorMiddleware());\n\n // TODO(cedric): `enhanceMiddleware` is deprecated, but is currently used to unify the middleware stacks\n // See: https://github.com/facebook/metro/commit/22e85fde85ec454792a1b70eba4253747a2587a9\n // See: https://github.com/facebook/metro/commit/d0d554381f119bb80ab09dbd6a1d310b54737e52\n const customEnhanceMiddleware = metroConfig.server.enhanceMiddleware;\n // @ts-expect-error: can't mutate readonly config\n metroConfig.server.enhanceMiddleware = (metroMiddleware: any, server: Metro.Server) => {\n if (customEnhanceMiddleware) {\n metroMiddleware = customEnhanceMiddleware(metroMiddleware, server);\n }\n return middleware.use(metroMiddleware);\n };\n }\n\n // Attach Expo Atlas if enabled\n await attachAtlasAsync({\n isExporting,\n exp,\n projectRoot,\n middleware,\n metroConfig,\n // NOTE(cedric): reset the Atlas file once, and reuse it for static exports\n resetAtlasFile: isExporting,\n });\n\n const { server, hmrServer, metro } = await runServer(\n metroBundler,\n metroConfig,\n {\n websocketEndpoints: {\n ...websocketEndpoints,\n ...createDevToolsPluginWebsocketEndpoint(),\n },\n watch: !isExporting && isWatchEnabled(),\n },\n {\n mockServer: isExporting,\n }\n );\n\n // Patch transform file to remove inconvenient customTransformOptions which are only used in single well-known files.\n const originalTransformFile = metro\n .getBundler()\n .getBundler()\n .transformFile.bind(metro.getBundler().getBundler());\n\n metro.getBundler().getBundler().transformFile = async function (\n filePath: string,\n transformOptions: TransformOptions,\n fileBuffer?: Buffer\n ) {\n return originalTransformFile(\n filePath,\n pruneCustomTransformOptions(\n filePath,\n // Clone the options so we don't mutate the original.\n {\n ...transformOptions,\n customTransformOptions: {\n __proto__: null,\n ...transformOptions.customTransformOptions,\n },\n }\n ),\n fileBuffer\n );\n };\n\n setEventReporter(eventsSocket.reportMetroEvent);\n\n // This function ensures that modules in source maps are sorted in the same\n // order as in a plain JS bundle.\n metro._getSortedModules = function (this: Metro.Server, graph: ReadOnlyGraph) {\n const modules = [...graph.dependencies.values()];\n\n const ctx = {\n platform: graph.transformOptions.platform,\n environment: graph.transformOptions.customTransformOptions?.environment,\n };\n // Assign IDs to modules in a consistent order\n for (const module of modules) {\n // @ts-expect-error\n this._createModuleId(module.path, ctx);\n }\n // Sort by IDs\n return modules.sort(\n // @ts-expect-error\n (a, b) => this._createModuleId(a.path, ctx) - this._createModuleId(b.path, ctx)\n );\n };\n\n if (hmrServer) {\n // Patch HMR Server to send more info to the `_createModuleId` function for deterministic module IDs.\n hmrServer._prepareMessage = async function (this: MetroHmrServer, group, options, changeEvent) {\n // Fork of https://github.com/facebook/metro/blob/3b3e0aaf725cfa6907bf2c8b5fbc0da352d29efe/packages/metro/src/HmrServer.js#L327-L393\n // with patch for `_createModuleId`.\n const logger = !options.isInitialUpdate ? changeEvent?.logger : null;\n try {\n const revPromise = this._bundler.getRevision(group.revisionId);\n if (!revPromise) {\n return {\n type: 'error',\n body: formatBundlingError(new RevisionNotFoundError(group.revisionId)),\n };\n }\n logger?.point('updateGraph_start');\n const { revision, delta } = await this._bundler.updateGraph(await revPromise, false);\n logger?.point('updateGraph_end');\n this._clientGroups.delete(group.revisionId);\n group.revisionId = revision.id;\n for (const client of group.clients) {\n client.revisionIds = client.revisionIds.filter(\n (revisionId) => revisionId !== group.revisionId\n );\n client.revisionIds.push(revision.id);\n }\n this._clientGroups.set(group.revisionId, group);\n logger?.point('serialize_start');\n // NOTE(EvanBacon): This is the patch\n const moduleIdContext = {\n platform: revision.graph.transformOptions.platform,\n environment: revision.graph.transformOptions.customTransformOptions?.environment,\n };\n const hmrUpdate = hmrJSBundle(delta, revision.graph, {\n clientUrl: group.clientUrl,\n // NOTE(EvanBacon): This is also the patch\n createModuleId: (moduleId: string) => {\n // @ts-expect-error\n return this._createModuleId(moduleId, moduleIdContext);\n },\n includeAsyncPaths: group.graphOptions.lazy,\n projectRoot: this._config.projectRoot,\n serverRoot: this._config.server.unstable_serverRoot ?? this._config.projectRoot,\n });\n logger?.point('serialize_end');\n return {\n type: 'update',\n body: {\n revisionId: revision.id,\n isInitialUpdate: options.isInitialUpdate,\n ...hmrUpdate,\n },\n };\n } catch (error: any) {\n const formattedError = formatBundlingError(error);\n this._config.reporter.update({\n type: 'bundling_error',\n error,\n });\n return {\n type: 'error',\n body: formattedError,\n };\n }\n };\n }\n\n return {\n metro,\n hmrServer,\n server,\n middleware,\n messageSocket: messagesSocket,\n };\n}\n\n// TODO: Fork the entire transform function so we can simply regex the file contents for keywords instead.\nfunction pruneCustomTransformOptions(\n filePath: string,\n transformOptions: TransformOptions\n): TransformOptions {\n // Normalize the filepath for cross platform checking.\n filePath = filePath.split(path.sep).join('/');\n\n if (\n transformOptions.customTransformOptions?.dom &&\n // The only generated file that needs the dom root is `expo/dom/entry.js`\n !filePath.match(/expo\\/dom\\/entry\\.js$/)\n ) {\n // Clear the dom root option if we aren't transforming the magic entry file, this ensures\n // that cached artifacts from other DOM component bundles can be reused.\n transformOptions.customTransformOptions.dom = 'true';\n }\n\n if (\n transformOptions.customTransformOptions?.routerRoot &&\n // The router root is used all over expo-router (`process.env.EXPO_ROUTER_ABS_APP_ROOT`, `process.env.EXPO_ROUTER_APP_ROOT`) so we'll just ignore the entire package.\n !(filePath.match(/\\/expo-router\\/_ctx/) || filePath.match(/\\/expo-router\\/build\\//))\n ) {\n // Set to the default value.\n transformOptions.customTransformOptions.routerRoot = 'app';\n }\n if (\n transformOptions.customTransformOptions?.asyncRoutes &&\n // The async routes settings are also used in `expo-router/_ctx.ios.js` (and other platform variants) via `process.env.EXPO_ROUTER_IMPORT_MODE`\n !(filePath.match(/\\/expo-router\\/_ctx/) || filePath.match(/\\/expo-router\\/build\\//))\n ) {\n delete transformOptions.customTransformOptions.asyncRoutes;\n }\n\n if (\n transformOptions.customTransformOptions?.clientBoundaries &&\n // The client boundaries are only used in `@expo/metro-runtime/src/virtual.js` for production RSC exports.\n !filePath.match(/\\/@expo\\/metro-runtime\\/rsc\\/virtual\\.js$/)\n ) {\n delete transformOptions.customTransformOptions.clientBoundaries;\n }\n\n return transformOptions;\n}\n\n/**\n * Simplify and communicate if Metro is running without watching file updates,.\n * Exposed for testing.\n */\nexport function isWatchEnabled() {\n if (env.CI) {\n Log.log(\n chalk`Metro is running in CI mode, reloads are disabled. Remove {bold CI=true} to enable watch mode.`\n );\n }\n\n return !env.CI;\n}\n"],"names":["loadMetroConfigAsync","instantiateMetroAsync","isWatchEnabled","LogRespectingTerminal","Terminal","constructor","stream","sendLog","args","_logLines","push","util","format","_scheduleUpdate","flush","console","log","info","terminal","process","stdout","projectRoot","options","exp","isExporting","getMetroBundler","config","reportEvent","serverActionsEnabled","experiments","reactServerFunctions","env","EXPO_UNSTABLE_SERVER_FUNCTIONS","reactServerComponentRoutes","EXPO_USE_METRO_REQUIRE","EXPO_USE_FAST_RESOLVER","serverRoot","getMetroServerRoot","terminalReporter","MetroTerminalReporter","hasConfig","resolveConfig","loadConfig","cwd","isEmpty","getDefaultConfig","undefined","reporter","update","event","globalThis","__requireCycleIgnorePatterns","resolver","requireCycleIgnorePatterns","transformer","publicPath","baseUrl","platformBundlers","getPlatformBundlers","reactCompiler","Log","warn","EXPO_UNSTABLE_TREE_SHAKING","EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH","CommandError","withMetroMultiPlatformAsync","isTsconfigPathsEnabled","tsconfigPaths","isFastResolverEnabled","isReactCanaryEnabled","reactCanary","isNamedRequiresEnabled","isReactServerComponentsEnabled","setEventReporter","logger","metroBundler","getConfig","skipSDKVersionRequirement","metroConfig","metro","getBundler","middleware","messagesSocket","eventsSocket","websocketEndpoints","createMetroMiddleware","prependMiddleware","createCorsMiddleware","debugMiddleware","debugWebsocketEndpoints","createDebugMiddleware","Object","assign","use","createJsInspectorMiddleware","customEnhanceMiddleware","server","enhanceMiddleware","metroMiddleware","attachAtlasAsync","resetAtlasFile","hmrServer","runServer","createDevToolsPluginWebsocketEndpoint","watch","mockServer","originalTransformFile","transformFile","bind","filePath","transformOptions","fileBuffer","pruneCustomTransformOptions","customTransformOptions","__proto__","reportMetroEvent","_getSortedModules","graph","modules","dependencies","values","ctx","platform","environment","module","_createModuleId","path","sort","a","b","_prepareMessage","group","changeEvent","isInitialUpdate","revision","revPromise","_bundler","getRevision","revisionId","type","body","formatBundlingError","RevisionNotFoundError","point","delta","updateGraph","_clientGroups","delete","id","client","clients","revisionIds","filter","set","moduleIdContext","hmrUpdate","hmrJSBundle","clientUrl","createModuleId","moduleId","includeAsyncPaths","graphOptions","lazy","_config","unstable_serverRoot","error","formattedError","messageSocket","split","sep","join","dom","match","routerRoot","asyncRoutes","clientBoundaries","CI","chalk"],"mappings":"AAAA;;;;;;;;;;;IA+DsBA,oBAAoB,MAApBA,oBAAoB;IAiHpBC,qBAAqB,MAArBA,qBAAqB;IAkQ3BC,cAAc,MAAdA,cAAc;;;yBAlbQ,cAAc;;;;;;;yBACjB,oBAAoB;;;;;;;yBACT,oBAAoB;;;;;;;8DAChD,OAAO;;;;;;;8DAKD,gDAAgD;;;;;;;8DAGtC,oDAAoD;;;;;;;8DACtD,mCAAmC;;;;;;;yBAChB,cAAc;;;;;;;yBACxC,YAAY;;;;;;;8DACpB,WAAW;;;;;;;8DACX,MAAM;;;;;;iDAE+B,mCAAmC;uCAEnD,yBAAyB;6BAC9B,yBAAyB;uCACpB,mCAAmC;uCACnC,o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from '@expo/config';\nimport { getMetroServerRoot } from '@expo/config/paths';\nimport { getDefaultConfig, LoadOptions } from '@expo/metro-config';\nimport chalk from 'chalk';\nimport http from 'http';\nimport type Metro from 'metro';\nimport { ReadOnlyGraph } from 'metro';\nimport Bundler from 'metro/src/Bundler';\nimport type { TransformOptions } from 'metro/src/DeltaBundler/Worker';\nimport MetroHmrServer from 'metro/src/HmrServer';\nimport RevisionNotFoundError from 'metro/src/IncrementalBundler/RevisionNotFoundError';\nimport formatBundlingError from 'metro/src/lib/formatBundlingError';\nimport { loadConfig, resolveConfig, ConfigT } from 'metro-config';\nimport { Terminal } from 'metro-core';\nimport util from 'node:util';\nimport path from 'path';\n\nimport { createDevToolsPluginWebsocketEndpoint } from './DevToolsPluginWebsocketEndpoint';\nimport { MetroBundlerDevServer } from './MetroBundlerDevServer';\nimport { MetroTerminalReporter } from './MetroTerminalReporter';\nimport { attachAtlasAsync } from './debugging/attachAtlas';\nimport { createDebugMiddleware } from './debugging/createDebugMiddleware';\nimport { createMetroMiddleware } from './dev-server/createMetroMiddleware';\nimport { runServer } from './runServer-fork';\nimport { withMetroMultiPlatformAsync } from './withMetroMultiPlatform';\nimport { Log } from '../../../log';\nimport { env } from '../../../utils/env';\nimport { CommandError } from '../../../utils/errors';\nimport { createCorsMiddleware } from '../middleware/CorsMiddleware';\nimport { createJsInspectorMiddleware } from '../middleware/inspector/createJsInspectorMiddleware';\nimport { prependMiddleware } from '../middleware/mutations';\nimport { getPlatformBundlers } from '../platformBundlers';\n\n// From expo/dev-server but with ability to use custom logger.\ntype MessageSocket = {\n broadcast: (method: string, params?: Record<string, any> | undefined) => void;\n};\n\n// Wrap terminal and polyfill console.log so we can log during bundling without breaking the indicator.\nclass LogRespectingTerminal extends Terminal {\n constructor(stream: import('node:net').Socket | import('node:stream').Writable) {\n super(stream);\n\n const sendLog = (...args: any[]) => {\n this._logLines.push(\n // format args like console.log\n util.format(...args)\n );\n this._scheduleUpdate();\n\n // Flush the logs to the terminal immediately so logs at the end of the process are not lost.\n this.flush();\n };\n\n console.log = sendLog;\n console.info = sendLog;\n }\n}\n\n// Share one instance of Terminal for all instances of Metro.\nconst terminal = new LogRespectingTerminal(process.stdout);\n\nexport async function loadMetroConfigAsync(\n projectRoot: string,\n options: LoadOptions,\n {\n exp,\n isExporting,\n getMetroBundler,\n }: { exp: ExpoConfig; isExporting: boolean; getMetroBundler: () => Bundler }\n) {\n let reportEvent: ((event: any) => void) | undefined;\n\n const serverActionsEnabled =\n exp.experiments?.reactServerFunctions ?? env.EXPO_UNSTABLE_SERVER_FUNCTIONS;\n\n if (serverActionsEnabled) {\n process.env.EXPO_UNSTABLE_SERVER_FUNCTIONS = '1';\n }\n\n // NOTE: Enable all the experimental Metro flags when RSC is enabled.\n if (exp.experiments?.reactServerComponentRoutes || serverActionsEnabled) {\n process.env.EXPO_USE_METRO_REQUIRE = '1';\n process.env.EXPO_USE_FAST_RESOLVER = '1';\n }\n\n const serverRoot = getMetroServerRoot(projectRoot);\n const terminalReporter = new MetroTerminalReporter(serverRoot, terminal);\n\n const hasConfig = await resolveConfig(options.config, projectRoot);\n let config: ConfigT = {\n ...(await loadConfig(\n { cwd: projectRoot, projectRoot, ...options },\n // If the project does not have a metro.config.js, then we use the default config.\n hasConfig.isEmpty ? getDefaultConfig(projectRoot) : undefined\n )),\n reporter: {\n update(event: any) {\n terminalReporter.update(event);\n if (reportEvent) {\n reportEvent(event);\n }\n },\n },\n };\n\n // @ts-expect-error: Set the global require cycle ignore patterns for SSR bundles. This won't work with custom global prefixes, but we don't use those.\n globalThis.__requireCycleIgnorePatterns = config.resolver?.requireCycleIgnorePatterns;\n\n if (isExporting) {\n // This token will be used in the asset plugin to ensure the path is correct for writing locally.\n // @ts-expect-error: typed as readonly.\n config.transformer.publicPath = `/assets?export_path=${\n (exp.experiments?.baseUrl ?? '') + '/assets'\n }`;\n } else {\n // @ts-expect-error: typed as readonly\n config.transformer.publicPath = '/assets/?unstable_path=.';\n }\n\n const platformBundlers = getPlatformBundlers(projectRoot, exp);\n\n if (exp.experiments?.reactCompiler) {\n Log.warn(`Experimental React Compiler is enabled.`);\n }\n\n if (env.EXPO_UNSTABLE_TREE_SHAKING && !env.EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH) {\n throw new CommandError(\n 'EXPO_UNSTABLE_TREE_SHAKING requires EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH to be enabled.'\n );\n }\n\n if (env.EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH) {\n Log.warn(`Experimental bundle optimization is enabled.`);\n }\n if (env.EXPO_UNSTABLE_TREE_SHAKING) {\n Log.warn(`Experimental tree shaking is enabled.`);\n }\n\n if (serverActionsEnabled) {\n Log.warn(\n `Experimental React Server Functions are enabled. Production exports are not supported yet.`\n );\n if (!exp.experiments?.reactServerComponentRoutes) {\n Log.warn(\n `- React Server Component routes are NOT enabled. Routes will render in client mode.`\n );\n }\n }\n\n config = await withMetroMultiPlatformAsync(projectRoot, {\n config,\n exp,\n platformBundlers,\n isTsconfigPathsEnabled: exp.experiments?.tsconfigPaths ?? true,\n isFastResolverEnabled: env.EXPO_USE_FAST_RESOLVER,\n isExporting,\n isReactCanaryEnabled:\n (exp.experiments?.reactServerComponentRoutes ||\n serverActionsEnabled ||\n exp.experiments?.reactCanary) ??\n false,\n isNamedRequiresEnabled: env.EXPO_USE_METRO_REQUIRE,\n isReactServerComponentsEnabled: !!exp.experiments?.reactServerComponentRoutes,\n getMetroBundler,\n });\n\n return {\n config,\n setEventReporter: (logger: (event: any) => void) => (reportEvent = logger),\n reporter: terminalReporter,\n };\n}\n\n/** The most generic possible setup for Metro bundler. */\nexport async function instantiateMetroAsync(\n metroBundler: MetroBundlerDevServer,\n options: Omit<LoadOptions, 'logger'>,\n {\n isExporting,\n exp = getConfig(metroBundler.projectRoot, {\n skipSDKVersionRequirement: true,\n }).exp,\n }: { isExporting: boolean; exp?: ExpoConfig }\n): Promise<{\n metro: Metro.Server;\n hmrServer: MetroHmrServer | null;\n server: http.Server;\n middleware: any;\n messageSocket: MessageSocket;\n}> {\n const projectRoot = metroBundler.projectRoot;\n\n const { config: metroConfig, setEventReporter } = await loadMetroConfigAsync(\n projectRoot,\n options,\n {\n exp,\n isExporting,\n getMetroBundler() {\n return metro.getBundler().getBundler();\n },\n }\n );\n\n // Create the core middleware stack for Metro, including websocket listeners\n const { middleware, messagesSocket, eventsSocket, websocketEndpoints } =\n createMetroMiddleware(metroConfig);\n\n if (!isExporting) {\n // Enable correct CORS headers for Expo Router features\n prependMiddleware(middleware, createCorsMiddleware(exp));\n\n // Enable debug middleware for CDP-related debugging\n const { debugMiddleware, debugWebsocketEndpoints } = createDebugMiddleware(metroBundler);\n Object.assign(websocketEndpoints, debugWebsocketEndpoints);\n middleware.use(debugMiddleware);\n middleware.use('/_expo/debugger', createJsInspectorMiddleware());\n\n // TODO(cedric): `enhanceMiddleware` is deprecated, but is currently used to unify the middleware stacks\n // See: https://github.com/facebook/metro/commit/22e85fde85ec454792a1b70eba4253747a2587a9\n // See: https://github.com/facebook/metro/commit/d0d554381f119bb80ab09dbd6a1d310b54737e52\n const customEnhanceMiddleware = metroConfig.server.enhanceMiddleware;\n // @ts-expect-error: can't mutate readonly config\n metroConfig.server.enhanceMiddleware = (metroMiddleware: any, server: Metro.Server) => {\n if (customEnhanceMiddleware) {\n metroMiddleware = customEnhanceMiddleware(metroMiddleware, server);\n }\n return middleware.use(metroMiddleware);\n };\n }\n\n // Attach Expo Atlas if enabled\n await attachAtlasAsync({\n isExporting,\n exp,\n projectRoot,\n middleware,\n metroConfig,\n // NOTE(cedric): reset the Atlas file once, and reuse it for static exports\n resetAtlasFile: isExporting,\n });\n\n const { server, hmrServer, metro } = await runServer(\n metroBundler,\n metroConfig,\n {\n websocketEndpoints: {\n ...websocketEndpoints,\n ...createDevToolsPluginWebsocketEndpoint(),\n },\n watch: !isExporting && isWatchEnabled(),\n },\n {\n mockServer: isExporting,\n }\n );\n\n // Patch transform file to remove inconvenient customTransformOptions which are only used in single well-known files.\n const originalTransformFile = metro\n .getBundler()\n .getBundler()\n .transformFile.bind(metro.getBundler().getBundler());\n\n metro.getBundler().getBundler().transformFile = async function (\n filePath: string,\n transformOptions: TransformOptions,\n fileBuffer?: Buffer\n ) {\n return originalTransformFile(\n filePath,\n pruneCustomTransformOptions(\n filePath,\n // Clone the options so we don't mutate the original.\n {\n ...transformOptions,\n customTransformOptions: {\n __proto__: null,\n ...transformOptions.customTransformOptions,\n },\n }\n ),\n fileBuffer\n );\n };\n\n setEventReporter(eventsSocket.reportMetroEvent);\n\n // This function ensures that modules in source maps are sorted in the same\n // order as in a plain JS bundle.\n metro._getSortedModules = function (this: Metro.Server, graph: ReadOnlyGraph) {\n const modules = [...graph.dependencies.values()];\n\n const ctx = {\n platform: graph.transformOptions.platform,\n environment: graph.transformOptions.customTransformOptions?.environment,\n };\n // Assign IDs to modules in a consistent order\n for (const module of modules) {\n // @ts-expect-error\n this._createModuleId(module.path, ctx);\n }\n // Sort by IDs\n return modules.sort(\n // @ts-expect-error\n (a, b) => this._createModuleId(a.path, ctx) - this._createModuleId(b.path, ctx)\n );\n };\n\n if (hmrServer) {\n let hmrJSBundle: typeof import('@expo/metro-config/build/serializer/fork/hmrJSBundle').default;\n\n try {\n hmrJSBundle = require('@expo/metro-config/build/serializer/fork/hmrJSBundle').default;\n } catch {\n // Add fallback for monorepo tests up until the fork is merged.\n Log.warn('Failed to load HMR serializer from @expo/metro-config, using fallback version.');\n hmrJSBundle = require('metro/src/DeltaBundler/Serializers/hmrJSBundle');\n }\n\n // Patch HMR Server to send more info to the `_createModuleId` function for deterministic module IDs and add support for serializing HMR updates the same as all other bundles.\n hmrServer._prepareMessage = async function (this: MetroHmrServer, group, options, changeEvent) {\n // Fork of https://github.com/facebook/metro/blob/3b3e0aaf725cfa6907bf2c8b5fbc0da352d29efe/packages/metro/src/HmrServer.js#L327-L393\n // with patch for `_createModuleId`.\n const logger = !options.isInitialUpdate ? changeEvent?.logger : null;\n try {\n const revPromise = this._bundler.getRevision(group.revisionId);\n if (!revPromise) {\n return {\n type: 'error',\n body: formatBundlingError(new RevisionNotFoundError(group.revisionId)),\n };\n }\n logger?.point('updateGraph_start');\n const { revision, delta } = await this._bundler.updateGraph(await revPromise, false);\n logger?.point('updateGraph_end');\n this._clientGroups.delete(group.revisionId);\n group.revisionId = revision.id;\n for (const client of group.clients) {\n client.revisionIds = client.revisionIds.filter(\n (revisionId) => revisionId !== group.revisionId\n );\n client.revisionIds.push(revision.id);\n }\n this._clientGroups.set(group.revisionId, group);\n logger?.point('serialize_start');\n // NOTE(EvanBacon): This is the patch\n const moduleIdContext = {\n platform: revision.graph.transformOptions.platform,\n environment: revision.graph.transformOptions.customTransformOptions?.environment,\n };\n const hmrUpdate = hmrJSBundle(delta, revision.graph, {\n clientUrl: group.clientUrl,\n // NOTE(EvanBacon): This is also the patch\n createModuleId: (moduleId: string) => {\n // @ts-expect-error\n return this._createModuleId(moduleId, moduleIdContext);\n },\n includeAsyncPaths: group.graphOptions.lazy,\n projectRoot: this._config.projectRoot,\n serverRoot: this._config.server.unstable_serverRoot ?? this._config.projectRoot,\n });\n logger?.point('serialize_end');\n return {\n type: 'update',\n body: {\n revisionId: revision.id,\n isInitialUpdate: options.isInitialUpdate,\n ...hmrUpdate,\n },\n };\n } catch (error: any) {\n const formattedError = formatBundlingError(error);\n this._config.reporter.update({\n type: 'bundling_error',\n error,\n });\n return {\n type: 'error',\n body: formattedError,\n };\n }\n };\n }\n\n return {\n metro,\n hmrServer,\n server,\n middleware,\n messageSocket: messagesSocket,\n };\n}\n\n// TODO: Fork the entire transform function so we can simply regex the file contents for keywords instead.\nfunction pruneCustomTransformOptions(\n filePath: string,\n transformOptions: TransformOptions\n): TransformOptions {\n // Normalize the filepath for cross platform checking.\n filePath = filePath.split(path.sep).join('/');\n\n if (\n transformOptions.customTransformOptions?.dom &&\n // The only generated file that needs the dom root is `expo/dom/entry.js`\n !filePath.match(/expo\\/dom\\/entry\\.js$/)\n ) {\n // Clear the dom root option if we aren't transforming the magic entry file, this ensures\n // that cached artifacts from other DOM component bundles can be reused.\n transformOptions.customTransformOptions.dom = 'true';\n }\n\n if (\n transformOptions.customTransformOptions?.routerRoot &&\n // The router root is used all over expo-router (`process.env.EXPO_ROUTER_ABS_APP_ROOT`, `process.env.EXPO_ROUTER_APP_ROOT`) so we'll just ignore the entire package.\n !(filePath.match(/\\/expo-router\\/_ctx/) || filePath.match(/\\/expo-router\\/build\\//))\n ) {\n // Set to the default value.\n transformOptions.customTransformOptions.routerRoot = 'app';\n }\n if (\n transformOptions.customTransformOptions?.asyncRoutes &&\n // The async routes settings are also used in `expo-router/_ctx.ios.js` (and other platform variants) via `process.env.EXPO_ROUTER_IMPORT_MODE`\n !(filePath.match(/\\/expo-router\\/_ctx/) || filePath.match(/\\/expo-router\\/build\\//))\n ) {\n delete transformOptions.customTransformOptions.asyncRoutes;\n }\n\n if (\n transformOptions.customTransformOptions?.clientBoundaries &&\n // The client boundaries are only used in `@expo/metro-runtime/src/virtual.js` for production RSC exports.\n !filePath.match(/\\/@expo\\/metro-runtime\\/rsc\\/virtual\\.js$/)\n ) {\n delete transformOptions.customTransformOptions.clientBoundaries;\n }\n\n return transformOptions;\n}\n\n/**\n * Simplify and communicate if Metro is running without watching file updates,.\n * Exposed for testing.\n */\nexport function isWatchEnabled() {\n if (env.CI) {\n Log.log(\n chalk`Metro is running in CI mode, reloads are disabled. Remove {bold CI=true} to enable watch mode.`\n );\n }\n\n return !env.CI;\n}\n"],"names":["loadMetroConfigAsync","instantiateMetroAsync","isWatchEnabled","LogRespectingTerminal","Terminal","constructor","stream","sendLog","args","_logLines","push","util","format","_scheduleUpdate","flush","console","log","info","terminal","process","stdout","projectRoot","options","exp","isExporting","getMetroBundler","config","reportEvent","serverActionsEnabled","experiments","reactServerFunctions","env","EXPO_UNSTABLE_SERVER_FUNCTIONS","reactServerComponentRoutes","EXPO_USE_METRO_REQUIRE","EXPO_USE_FAST_RESOLVER","serverRoot","getMetroServerRoot","terminalReporter","MetroTerminalReporter","hasConfig","resolveConfig","loadConfig","cwd","isEmpty","getDefaultConfig","undefined","reporter","update","event","globalThis","__requireCycleIgnorePatterns","resolver","requireCycleIgnorePatterns","transformer","publicPath","baseUrl","platformBundlers","getPlatformBundlers","reactCompiler","Log","warn","EXPO_UNSTABLE_TREE_SHAKING","EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH","CommandError","withMetroMultiPlatformAsync","isTsconfigPathsEnabled","tsconfigPaths","isFastResolverEnabled","isReactCanaryEnabled","reactCanary","isNamedRequiresEnabled","isReactServerComponentsEnabled","setEventReporter","logger","metroBundler","getConfig","skipSDKVersionRequirement","metroConfig","metro","getBundler","middleware","messagesSocket","eventsSocket","websocketEndpoints","createMetroMiddleware","prependMiddleware","createCorsMiddleware","debugMiddleware","debugWebsocketEndpoints","createDebugMiddleware","Object","assign","use","createJsInspectorMiddleware","customEnhanceMiddleware","server","enhanceMiddleware","metroMiddleware","attachAtlasAsync","resetAtlasFile","hmrServer","runServer","createDevToolsPluginWebsocketEndpoint","watch","mockServer","originalTransformFile","transformFile","bind","filePath","transformOptions","fileBuffer","pruneCustomTransformOptions","customTransformOptions","__proto__","reportMetroEvent","_getSortedModules","graph","modules","dependencies","values","ctx","platform","environment","module","_createModuleId","path","sort","a","b","hmrJSBundle","require","default","_prepareMessage","group","changeEvent","isInitialUpdate","revision","revPromise","_bundler","getRevision","revisionId","type","body","formatBundlingError","RevisionNotFoundError","point","delta","updateGraph","_clientGroups","delete","id","client","clients","revisionIds","filter","set","moduleIdContext","hmrUpdate","clientUrl","createModuleId","moduleId","includeAsyncPaths","graphOptions","lazy","_config","unstable_serverRoot","error","formattedError","messageSocket","split","sep","join","dom","match","routerRoot","asyncRoutes","clientBoundaries","CI","chalk"],"mappings":"AAAA;;;;;;;;;;;IA8DsBA,oBAAoB,MAApBA,oBAAoB;IAiHpBC,qBAAqB,MAArBA,qBAAqB;IA4Q3BC,cAAc,MAAdA,cAAc;;;yBA3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,IACzD,0GAA0G;IAC1G,CAACpE,QAAQ,CAACiE,KAAK,6CAA6C,EAC5D;QACA,OAAOhE,gBAAgB,CAACG,sBAAsB,CAACgE,gBAAgB,CAAC;IAClE,CAAC;IAED,OAAOnE,gBAAgB,CAAC;AAC1B,CAAC;AAMM,SAAS5G,cAAc,GAAG;IAC/B,IAAI6B,IAAG,IAAA,CAACmJ,EAAE,EAAE;QACVtH,IAAG,IAAA,CAAC5C,GAAG,CACLmK,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,8FAA8F,CAAC,CACtG,CAAC;IACJ,CAAC;IAED,OAAO,CAACpJ,IAAG,IAAA,CAACmJ,EAAE,CAAC;AACjB,CAAC"}
|
|
@@ -414,6 +414,10 @@ function withExtendedResolver(config, { tsconfig , isTsconfigPathsEnabled , isFa
|
|
|
414
414
|
if (moduleName.endsWith("/package.json")) {
|
|
415
415
|
return null;
|
|
416
416
|
}
|
|
417
|
+
// Skip applying JS externals for CSS files.
|
|
418
|
+
if (/\.(s?css|sass)$/.test(context.originModulePath)) {
|
|
419
|
+
return null;
|
|
420
|
+
}
|
|
417
421
|
const environment = (ref = context.customResolverOptions) == null ? void 0 : ref.environment;
|
|
418
422
|
const strictResolve = getStrictResolver(context, platform);
|
|
419
423
|
for (const external of externals){
|