@expo/metro-config 58.0.11 → 58.0.12
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/serializer/chunking/Chunk.d.ts +45 -0
- package/build/serializer/chunking/Chunk.js +409 -0
- package/build/serializer/chunking/Chunk.js.map +1 -0
- package/build/serializer/chunking/chunkingStrategy.d.ts +40 -0
- package/build/serializer/chunking/chunkingStrategy.js +155 -0
- package/build/serializer/chunking/chunkingStrategy.js.map +1 -0
- package/build/serializer/chunking/computeBitSetChunks.d.ts +49 -0
- package/build/serializer/chunking/computeBitSetChunks.js +268 -0
- package/build/serializer/chunking/computeBitSetChunks.js.map +1 -0
- package/build/serializer/{computeChunkFilenames.d.ts → chunking/computeChunkFilenames.d.ts} +1 -1
- package/build/serializer/chunking/computeChunkFilenames.js.map +1 -0
- package/build/serializer/chunking/createGranularChunkingStrategy.d.ts +2 -0
- package/build/serializer/chunking/createGranularChunkingStrategy.js +282 -0
- package/build/serializer/chunking/createGranularChunkingStrategy.js.map +1 -0
- package/build/serializer/chunking/createLegacyChunkingStrategy.d.ts +2 -0
- package/build/serializer/chunking/createLegacyChunkingStrategy.js +167 -0
- package/build/serializer/chunking/createLegacyChunkingStrategy.js.map +1 -0
- package/build/serializer/chunking/findUnsupportedWorkerAsyncDependency.d.ts +7 -0
- package/build/serializer/chunking/findUnsupportedWorkerAsyncDependency.js +54 -0
- package/build/serializer/chunking/findUnsupportedWorkerAsyncDependency.js.map +1 -0
- package/build/serializer/exportPath.d.ts +1 -0
- package/build/serializer/exportPath.js +18 -3
- package/build/serializer/exportPath.js.map +1 -1
- package/build/serializer/fork/baseJSBundle.d.ts +5 -1
- package/build/serializer/fork/baseJSBundle.js +23 -1
- package/build/serializer/fork/baseJSBundle.js.map +1 -1
- package/build/serializer/fork/js.d.ts +6 -4
- package/build/serializer/fork/js.js +11 -1
- package/build/serializer/fork/js.js.map +1 -1
- package/build/serializer/fork/processModules.d.ts +4 -14
- package/build/serializer/fork/processModules.js +2 -12
- package/build/serializer/fork/processModules.js.map +1 -1
- package/build/serializer/serializeChunks.d.ts +4 -47
- package/build/serializer/serializeChunks.js +17 -655
- package/build/serializer/serializeChunks.js.map +1 -1
- package/build/serializer/serializerAssets.d.ts +13 -1
- package/build/serializer/withExpoSerializers.js +11 -1
- package/build/serializer/withExpoSerializers.js.map +1 -1
- package/package.json +3 -3
- package/build/serializer/computeChunkFilenames.js.map +0 -1
- /package/build/serializer/{computeChunkFilenames.js → chunking/computeChunkFilenames.js} +0 -0
|
@@ -124,7 +124,8 @@ function baseJSBundleWithDependencies(entryPoint, preModules, dependencies, opti
|
|
|
124
124
|
baseUrl: options.baseUrl,
|
|
125
125
|
splitChunks: options.splitChunks,
|
|
126
126
|
skipWrapping: options.skipWrapping,
|
|
127
|
-
computedAsyncModulePaths: options.computedAsyncModulePaths
|
|
127
|
+
computedAsyncModulePaths: options.computedAsyncModulePaths,
|
|
128
|
+
unstable_getAsyncDependencyPath: options.unstable_getAsyncDependencyPath
|
|
128
129
|
};
|
|
129
130
|
// Do not prepend polyfills or the require runtime when only modules are requested
|
|
130
131
|
if (options.modulesOnly) {
|
|
@@ -154,6 +155,27 @@ function baseJSBundleWithDependencies(entryPoint, preModules, dependencies, opti
|
|
|
154
155
|
// different extension. Since it's unclear to me (Bacon) how it is used on native, I'm only disabling in web and native in production.
|
|
155
156
|
sourceUrl: options.platform === 'web' ? undefined : !options.dev ? undefined : options.sourceUrl
|
|
156
157
|
});
|
|
158
|
+
if (options.includeChunkCompletion && options.platform === 'web' && !options.dev) {
|
|
159
|
+
// Read the URL from currentScript because this footer contributes to the chunk's filename hash.
|
|
160
|
+
const key = JSON.stringify(`${options.globalPrefix ?? ''}__expo_chunk_completion__`);
|
|
161
|
+
const code = `(function(){var s=typeof document!=="undefined"&&document.currentScript;if(s&&s.namespaceURI==="http://www.w3.org/1999/xhtml"&&s.tagName==="SCRIPT"&&typeof s.src==="string"&&s.src){var k=${key};(globalThis[k]||(globalThis[k]=new Set())).add(s.src);}})();`;
|
|
162
|
+
modulesWithAnnotations.unshift({
|
|
163
|
+
path: 'expo-chunk-completion',
|
|
164
|
+
dependencies: new Map(),
|
|
165
|
+
inverseDependencies: new (_CountingSet()).default(),
|
|
166
|
+
getSource: ()=>Buffer.from(code),
|
|
167
|
+
output: [
|
|
168
|
+
{
|
|
169
|
+
type: 'js/script/virtual',
|
|
170
|
+
data: {
|
|
171
|
+
code,
|
|
172
|
+
lineCount: (0, _countLines().default)(code),
|
|
173
|
+
map: []
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
});
|
|
178
|
+
}
|
|
157
179
|
// If the `debugId` annotation is available and we aren't inlining the source map, add it to the bundle.
|
|
158
180
|
// NOTE: We may want to move this assertion up further.
|
|
159
181
|
const hasExternalMaps = !options.inlineSourceMap && !!sourceMapUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["serializer/fork/baseJSBundle.ts"],"sourcesContent":[null],"names":["baseJSBundle","baseJSBundleWithDependencies","getBaseUrlOption","getPlatformOption","graph","options","transformOptions","platform","sourceUrl","isJscSafeUrl","toNormalUrl","url","URL","searchParams","get","baseUrl","customTransformOptions","mayBeEncoded","serializerOptions","option","decodeURIComponent","replace","entryPoint","preModules","Error","dependencies","values","splitChunks","skipWrapping","computedAsyncModulePaths","module","createModuleId","path","processModulesOptions","filter","processModuleFilter","dev","includeAsyncPaths","projectRoot","serverRoot","modulesOnly","preCode","processModules","map","code","src","join","modules","sort","a","b","sourceMapUrl","includeSourceMaps","undefined","modulesWithAnnotations","getAppendScripts","asyncRequireModulePath","getRunModuleStatement","getSourceUrl","globalPrefix","inlineSourceMap","runBeforeMainModule","runModule","shouldAddToIgnoreList","
|
|
1
|
+
{"version":3,"sources":["serializer/fork/baseJSBundle.ts"],"sourcesContent":[null],"names":["baseJSBundle","baseJSBundleWithDependencies","getBaseUrlOption","getPlatformOption","graph","options","transformOptions","platform","sourceUrl","isJscSafeUrl","toNormalUrl","url","URL","searchParams","get","baseUrl","customTransformOptions","mayBeEncoded","serializerOptions","option","decodeURIComponent","replace","entryPoint","preModules","Error","dependencies","values","splitChunks","skipWrapping","computedAsyncModulePaths","module","createModuleId","path","processModulesOptions","filter","processModuleFilter","dev","includeAsyncPaths","projectRoot","serverRoot","unstable_getAsyncDependencyPath","modulesOnly","preCode","processModules","map","code","src","join","modules","sort","a","b","sourceMapUrl","includeSourceMaps","undefined","modulesWithAnnotations","getAppendScripts","asyncRequireModulePath","getRunModuleStatement","getSourceUrl","globalPrefix","inlineSourceMap","runBeforeMainModule","runModule","shouldAddToIgnoreList","includeChunkCompletion","key","JSON","stringify","unshift","Map","inverseDependencies","CountingSet","getSource","Buffer","from","output","type","data","lineCount","countLines","hasExternalMaps","debugId","push","postCode","mods","pre","post","id","paths","Object","fromEntries","keys","length"],"mappings":"AAAA;;;;;;;;;CASC;;;;;;;;;;;;;;;;;QAmFeA;eAAAA;;QAqBAC;eAAAA;;QApCAC;eAAAA;;QAlBAC;eAAAA;;;;gEA1CQ;;;;;;;gEACD;;;;;;;gEACM;;;;;;;yBACa;;;;;;gCAGX;;;;;;AAoCxB,SAASA,kBACdC,KAA8C,EAC9CC,OAA6C;IAE7C,IAAID,MAAME,gBAAgB,EAAEC,YAAY,MAAM;QAC5C,OAAOH,MAAME,gBAAgB,CAACC,QAAQ;IACxC;IACA,IAAI,CAACF,QAAQG,SAAS,EAAE;QACtB,OAAO;IACT;IAEA,MAAMA,YAAYC,IAAAA,0BAAY,EAACJ,QAAQG,SAAS,IAC5CE,IAAAA,yBAAW,EAACL,QAAQG,SAAS,IAC7BH,QAAQG,SAAS;IACrB,MAAMG,MAAM,IAAIC,IAAIJ,WAAW;IAC/B,OAAOG,IAAIE,YAAY,CAACC,GAAG,CAAC,eAAe;AAC7C;AAEO,SAASZ,iBACdE,KAA8C,EAC9CC,OAAyD;IAEzD,MAAMU,UAAUX,MAAME,gBAAgB,EAAEU,wBAAwB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C,CAAC4C,IAAI3C,KAAK,GAAK;gBAChC2C;gBACA,OAAO3C,SAAS,WAAWA,OAAOA,MAAMC;aACzC;QACD2C,OAAOC,OAAOC,WAAW,CACvB,AACEN,KAAKnD,MAAM,CACT,CAAC,CAACsD,IAAI3C,KAAK,GAAK,OAAOA,SAAS,YAAY6C,OAAOE,IAAI,CAAC/C,MAAM4C,SAAS,CAAC,GAAGI,MAAM,EAEnFjD,GAAG,CAAC,CAAC,CAAC4C,IAAI3C,KAAK,GAAK;gBAAC2C;gBAAI3C,KAAK4C,KAAK;aAAC;IAE1C;AACF"}
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { JsOutput } from '@expo/metro/metro-transform-worker';
|
|
12
12
|
import type { MixedOutput, Module } from '@expo/metro/metro/DeltaBundler';
|
|
13
|
-
|
|
13
|
+
import type { SerializerOptions } from '@expo/metro/metro/DeltaBundler/types';
|
|
14
|
+
import type { AsyncModulePaths } from '../serializerAssets';
|
|
15
|
+
export type Options = Pick<SerializerOptions, 'unstable_getAsyncDependencyPath'> & {
|
|
14
16
|
createModuleId: (module: string) => number | string;
|
|
15
17
|
dev: boolean;
|
|
16
18
|
includeAsyncPaths: boolean;
|
|
@@ -23,11 +25,11 @@ export type Options = {
|
|
|
23
25
|
};
|
|
24
26
|
export declare function wrapModule(module: Module, options: Options): {
|
|
25
27
|
src: string;
|
|
26
|
-
paths:
|
|
28
|
+
paths: AsyncModulePaths;
|
|
27
29
|
};
|
|
28
|
-
export declare function getModuleParams(module: Module, options: Pick<Options, 'createModuleId' | 'sourceUrl' | 'includeAsyncPaths' | 'serverRoot' | 'splitChunks' | 'dev' | 'projectRoot' | 'computedAsyncModulePaths'>): {
|
|
30
|
+
export declare function getModuleParams(module: Module, options: Pick<Options, 'createModuleId' | 'sourceUrl' | 'includeAsyncPaths' | 'serverRoot' | 'splitChunks' | 'dev' | 'projectRoot' | 'computedAsyncModulePaths' | 'unstable_getAsyncDependencyPath'>): {
|
|
29
31
|
params: any[];
|
|
30
|
-
paths:
|
|
32
|
+
paths: AsyncModulePaths;
|
|
31
33
|
};
|
|
32
34
|
export declare function getJsOutput(module: {
|
|
33
35
|
output: readonly MixedOutput[];
|
|
@@ -119,7 +119,17 @@ function getModuleParams(module1, options) {
|
|
|
119
119
|
// is created. This is required for production bundle splitting.
|
|
120
120
|
// options.includeAsyncPaths &&
|
|
121
121
|
dependency.data.data.asyncType != null) {
|
|
122
|
-
if (options.
|
|
122
|
+
if (options.unstable_getAsyncDependencyPath) {
|
|
123
|
+
// Prefer the callback: production exports also set sourceUrl.
|
|
124
|
+
if (options.includeAsyncPaths) {
|
|
125
|
+
const asyncPath = options.unstable_getAsyncDependencyPath(dependency, options);
|
|
126
|
+
if (asyncPath != null) {
|
|
127
|
+
(0, _assert().default)(typeof asyncPath === 'string' || Array.isArray(asyncPath) && asyncPath.every((path)=>typeof path === 'string'), `Async path for ${dependency.absolutePath} must be a string or an array of strings.`);
|
|
128
|
+
paths[id] = asyncPath;
|
|
129
|
+
hasPaths = true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
} else if (options.includeAsyncPaths) {
|
|
123
133
|
if (options.sourceUrl) {
|
|
124
134
|
hasPaths = true;
|
|
125
135
|
// TODO: Only include path if the target is not in the bundle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["serializer/fork/js.ts"],"sourcesContent":[null],"names":["getJsOutput","getModuleParams","isJsModule","isJsOutput","wrapModule","module","options","output","type","startsWith","src","data","code","paths","params","addParamsToDefineCall","moduleId","createModuleId","path","hasPaths","dependencyMapArray","Array","from","dependencies","values","map","dependency","isResolvedDependency","modulePath","absolutePath","isOptional","name","Error","JSON","stringify","id","asyncType","includeAsyncPaths","sourceUrl","searchParams","URL","jscSafeUrl","toNormalUrl","set","delete","bundlePath","relative","serverRoot","join","dirname","basename","extname","toString","splitChunks","computedAsyncModulePaths","dev","push","normalizePathSeparatorsToPosix","projectRoot","jsModules","filter","
|
|
1
|
+
{"version":3,"sources":["serializer/fork/js.ts"],"sourcesContent":[null],"names":["getJsOutput","getModuleParams","isJsModule","isJsOutput","wrapModule","module","options","output","type","startsWith","src","data","code","paths","params","addParamsToDefineCall","moduleId","createModuleId","path","hasPaths","dependencyMapArray","Array","from","dependencies","values","map","dependency","isResolvedDependency","modulePath","absolutePath","isOptional","name","Error","JSON","stringify","id","asyncType","unstable_getAsyncDependencyPath","includeAsyncPaths","asyncPath","assert","isArray","every","sourceUrl","searchParams","URL","jscSafeUrl","toNormalUrl","set","delete","bundlePath","relative","serverRoot","join","dirname","basename","extname","toString","splitChunks","computedAsyncModulePaths","dev","push","normalizePathSeparatorsToPosix","projectRoot","jsModules","filter","length","jsOutput","Number","isFinite","lineCount"],"mappings":"AAAA;;;;;;;;;CASC;;;;;;;;;;;;;;;;;;QAmKeA;eAAAA;;QAzHAC;eAAAA;;QAmJAC;eAAAA;;QAIAC;eAAAA;;QAtKAC;eAAAA;;;;yBAzBsB;;;;;;;yBAID;;;;;;;gEAClB;;;;;;;gEACI;;;;;;;gEACN;;;;;;0BAG6C;;;;;;AAevD,SAASA,WACdC,OAAc,EACdC,OAAgB;IAEhB,MAAMC,SAASP,YAAYK;IAE3B,IAAIE,OAAOC,IAAI,CAACC,UAAU,CAAC,cAAc;QACvC,OAAO;YAAEC,KAAKH,OAAOI,IAAI,CAACC,IAAI;YAAEC,OAAO,CAAC;QAAE;IAC5C;IAEA,MAAM,EAAEC,MAAM,EAAED,KAAK,EAAE,GAAGZ,gBAAgBI,SAAQC;IAClD,MAAMI,MAAMK,IAAAA,8CAAqB,EAACR,OAAOI,IAAI,CAACC,IAAI,KAAKE;IACvD,OAAO;QAAEJ;QAAKG;IAAM;AACtB;AAEO,SAASZ,gBACdI,OAAc,EACdC,OAWC;IAED,MAAMU,WAAWV,QAAQW,cAAc,CAACZ,QAAOa,IAAI;IAEnD,MAAML,QAA0B,CAAC;IACjC,IAAIM,WAAW;IAEf,MAAMC,qBAAqBC,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I,EAAE,GAAKA,KAAKC,UAAU,CAAC;IAErE+B,IAAAA,iBAAM,EACJwB,UAAUE,MAAM,KAAK,GACrB,CAAC,6CAA6C,EAAE7D,QAAOa,IAAI,IAAI,iBAAiB,KAAK,EACnF8C,UAAUE,MAAM,CACjB,YAAY,CAAC;IAGhB,MAAMC,WAAqBH,SAAS,CAAC,EAAE;IAEvCxB,IAAAA,iBAAM,EACJ4B,OAAOC,QAAQ,CAACF,SAASxD,IAAI,CAAC2D,SAAS,GACvC,CAAC,uCAAuC,EAAEjE,QAAOa,IAAI,IAAI,iBAAiB,KAAK,EAC7EiD,SAAS3D,IAAI,CACd,wBAAwB,EAAE2D,SAASxD,IAAI,CAAC2D,SAAS,CAAC,CAAC,CAAC;IAGvD,OAAOH;AACT;AAEO,SAASjE,WAAWG,OAAc;IACvC,OAAOA,QAAOE,MAAM,CAAC0D,MAAM,CAAC9D,YAAY+D,MAAM,GAAG;AACnD;AAEO,SAAS/D,WAAWI,MAAmB;IAC5C,OAAOA,OAAOC,IAAI,CAACC,UAAU,CAAC;AAChC"}
|
|
@@ -6,18 +6,8 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
import type { Module } from '@expo/metro/metro/DeltaBundler';
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
import type { Options } from './js';
|
|
10
|
+
import { wrapModule } from './js';
|
|
11
|
+
export declare function processModules(modules: readonly Module[], { filter, ...options }: Options & {
|
|
11
12
|
filter?: (module: Module) => boolean;
|
|
12
|
-
|
|
13
|
-
dev: boolean;
|
|
14
|
-
includeAsyncPaths: boolean;
|
|
15
|
-
projectRoot: string;
|
|
16
|
-
serverRoot: string;
|
|
17
|
-
sourceUrl?: string | null;
|
|
18
|
-
skipWrapping: boolean;
|
|
19
|
-
computedAsyncModulePaths: Record<string, string> | null;
|
|
20
|
-
}): readonly [Module, {
|
|
21
|
-
src: string;
|
|
22
|
-
paths: Record<string, string>;
|
|
23
|
-
}][];
|
|
13
|
+
}): readonly [Module, ReturnType<typeof wrapModule>][];
|
|
@@ -15,22 +15,12 @@ Object.defineProperty(exports, "processModules", {
|
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
const _js = require("./js");
|
|
18
|
-
function processModules(modules, { filter = ()=>true,
|
|
18
|
+
function processModules(modules, { filter = ()=>true, ...options }) {
|
|
19
19
|
return [
|
|
20
20
|
...modules
|
|
21
21
|
].filter(_js.isJsModule).filter(filter).map((module)=>[
|
|
22
22
|
module,
|
|
23
|
-
(0, _js.wrapModule)(module,
|
|
24
|
-
splitChunks,
|
|
25
|
-
createModuleId,
|
|
26
|
-
dev,
|
|
27
|
-
includeAsyncPaths,
|
|
28
|
-
projectRoot,
|
|
29
|
-
serverRoot,
|
|
30
|
-
sourceUrl,
|
|
31
|
-
skipWrapping,
|
|
32
|
-
computedAsyncModulePaths
|
|
33
|
-
})
|
|
23
|
+
(0, _js.wrapModule)(module, options)
|
|
34
24
|
]);
|
|
35
25
|
}
|
|
36
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["serializer/fork/processModules.ts"],"sourcesContent":[null],"names":["processModules","modules","filter","
|
|
1
|
+
{"version":3,"sources":["serializer/fork/processModules.ts"],"sourcesContent":[null],"names":["processModules","modules","filter","options","isJsModule","map","module","wrapModule"],"mappings":"AAAA;;;;;;CAMC;;;;+BAOeA;;;eAAAA;;;oBAFuB;AAEhC,SAASA,eACdC,OAA0B,EAC1B,EACEC,SAAS,IAAM,IAAI,EACnB,GAAGC,SAGJ;IAED,OAAO;WAAIF;KAAQ,CAChBC,MAAM,CAACE,cAAU,EACjBF,MAAM,CAACA,QACPG,GAAG,CAAC,CAACC,SAAmB;YAACA;YAAQC,IAAAA,cAAU,EAACD,QAAQH;SAAS;AAClE"}
|
|
@@ -5,57 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import type { MetroConfig, AssetData } from '@expo/metro/metro';
|
|
8
|
-
import type { ConfigT
|
|
9
|
-
import type {
|
|
10
|
-
import type { ExpoSerializerOptions } from './fork/baseJSBundle';
|
|
8
|
+
import type { ConfigT } from '@expo/metro/metro-config';
|
|
9
|
+
import type { SerializeChunkOptions } from './chunking/chunkingStrategy';
|
|
11
10
|
import type { SerialAsset } from './serializerAssets';
|
|
12
|
-
|
|
11
|
+
export { Chunk, getSortedModules } from './chunking/Chunk';
|
|
12
|
+
export type { SerializeChunkOptions } from './chunking/chunkingStrategy';
|
|
13
13
|
type Serializer = NonNullable<ConfigT['serializer']['customSerializer']>;
|
|
14
14
|
type SerializerParameters = Parameters<Serializer>;
|
|
15
|
-
export type SerializeChunkOptions = {
|
|
16
|
-
includeSourceMaps: boolean;
|
|
17
|
-
splitChunks: boolean;
|
|
18
|
-
} & SerializerConfigOptions;
|
|
19
15
|
export declare function graphToSerialAssetsAsync(config: MetroConfig, serializeChunkOptions: SerializeChunkOptions, ...props: SerializerParameters): Promise<{
|
|
20
16
|
artifacts: SerialAsset[] | null;
|
|
21
17
|
assets: AssetData[];
|
|
22
18
|
}>;
|
|
23
|
-
export declare class Chunk {
|
|
24
|
-
name: string;
|
|
25
|
-
entries: Set<Module<MixedOutput>>;
|
|
26
|
-
graph: ReadOnlyGraph<MixedOutput>;
|
|
27
|
-
options: ExpoSerializerOptions;
|
|
28
|
-
isAsync: boolean;
|
|
29
|
-
isVendor: boolean;
|
|
30
|
-
isEntry: boolean;
|
|
31
|
-
deps: Set<Module>;
|
|
32
|
-
preModules: Set<Module>;
|
|
33
|
-
requiredChunks: Set<Chunk>;
|
|
34
|
-
/** Whether this chunk owns an isolated module registry and must retain all of its dependencies.
|
|
35
|
-
* @remarks
|
|
36
|
-
* When a chunk is sealed, its `deps` and `preModules` shouldn't be altered, and it doesn't qualify
|
|
37
|
-
* for bundle/chunk splitting. This is the case for web workers, which must form a "closed" and
|
|
38
|
-
* self-sufficient entry bundle.
|
|
39
|
-
*/
|
|
40
|
-
sealed: boolean;
|
|
41
|
-
constructor(name: string, entries: Set<Module<MixedOutput>>, graph: ReadOnlyGraph<MixedOutput>, options: ExpoSerializerOptions, isAsync?: boolean, isVendor?: boolean, isEntry?: boolean);
|
|
42
|
-
seal(): void;
|
|
43
|
-
private getPlatform;
|
|
44
|
-
getFilename(src: string): string;
|
|
45
|
-
getStableChunkSource(serializerConfig: Partial<SerializerConfigT>): string;
|
|
46
|
-
private serializeToCodeWithTemplates;
|
|
47
|
-
hasAbsolutePath(absolutePath: string): boolean;
|
|
48
|
-
private _asyncTargets?;
|
|
49
|
-
getAsyncChunkTargets(chunkByPath: Map<string, Chunk>): Set<Chunk>;
|
|
50
|
-
private getComputedPathsForAsyncDependencies;
|
|
51
|
-
private getAdjustedSourceMapUrl;
|
|
52
|
-
private serializeToCode;
|
|
53
|
-
private boolishTransformOption;
|
|
54
|
-
serializeToAssetsAsync(serializerConfig: Partial<SerializerConfigT>, chunksByPath: Map<string, Chunk>, filenamesByChunk: Map<Chunk, string>, { includeSourceMaps, unstable_beforeAssetSerializationPlugins }: SerializeChunkOptions): Promise<SerialAsset[]>;
|
|
55
|
-
private supportsBytecode;
|
|
56
|
-
isHermesEnabled(): boolean;
|
|
57
|
-
}
|
|
58
|
-
export declare function getSortedModules(modules: Module<MixedOutput>[], { createModuleId, }: {
|
|
59
|
-
createModuleId: (path: string) => number;
|
|
60
|
-
}): readonly Module<any>[];
|
|
61
|
-
export {};
|