mirror of
https://github.com/status-im/metro.git
synced 2025-01-11 11:34:24 +00:00
More cleanup of unneeded option params
Reviewed By: cpojer Differential Revision: D7334077 fbshipit-source-id: ca3359e0e866a84cb57a298ae09c6dd6005d3242
This commit is contained in:
parent
93c2f102b5
commit
69755c9a0d
@ -48,13 +48,11 @@ describe('DeltaCalculator', () => {
|
||||
excludeSource: false,
|
||||
hot: true,
|
||||
inlineSourceMap: true,
|
||||
isolateModuleIDs: false,
|
||||
minify: false,
|
||||
platform: 'ios',
|
||||
runBeforeMainModule: ['core'],
|
||||
runModule: true,
|
||||
sourceMapUrl: undefined,
|
||||
unbundle: false,
|
||||
};
|
||||
|
||||
function createModule({path, name, isAsset, isJSON}) {
|
||||
|
@ -100,7 +100,6 @@ class Server {
|
||||
hasteImplModulePath?: string,
|
||||
maxWorkers: number,
|
||||
minifierPath: string,
|
||||
moduleFormat: string,
|
||||
platforms: Array<string>,
|
||||
polyfillModuleNames: Array<string>,
|
||||
postMinifyProcess: PostMinifyProcess,
|
||||
@ -167,8 +166,6 @@ class Server {
|
||||
options.minifierPath == null
|
||||
? defaults.DEFAULT_METRO_MINIFIER_PATH
|
||||
: resolveSync(options.minifierPath, {basedir: process.cwd()}),
|
||||
moduleFormat:
|
||||
options.moduleFormat != null ? options.moduleFormat : 'haste',
|
||||
platforms: options.platforms || defaults.platforms,
|
||||
polyfillModuleNames: options.polyfillModuleNames || [],
|
||||
postMinifyProcess: options.postMinifyProcess,
|
||||
@ -200,7 +197,6 @@ class Server {
|
||||
const {
|
||||
createModuleId,
|
||||
getModulesRunBeforeMainModule,
|
||||
moduleFormat,
|
||||
silent,
|
||||
...bundlerOptionsFromServerOptions
|
||||
} = this._opts;
|
||||
@ -998,7 +994,7 @@ class Server {
|
||||
});
|
||||
}
|
||||
|
||||
_getOptionsFromUrl(reqUrl: string): BundleOptions & DeltaOptions {
|
||||
_getOptionsFromUrl(reqUrl: string): DeltaOptions {
|
||||
// `true` to parse the query param as an object.
|
||||
const urlObj = nullthrows(url.parse(reqUrl, true));
|
||||
const urlQuery = nullthrows(urlObj.query);
|
||||
@ -1079,9 +1075,7 @@ class Server {
|
||||
runBeforeMainModule: this._opts.getModulesRunBeforeMainModule(entryFile),
|
||||
runModule: this._getBoolOptionFromQuery(urlObj.query, 'runModule', true),
|
||||
inlineSourceMap: includeSource,
|
||||
isolateModuleIDs: false,
|
||||
platform,
|
||||
resolutionResponse: null,
|
||||
entryModuleOnly: this._getBoolOptionFromQuery(
|
||||
urlObj.query,
|
||||
'entryModuleOnly',
|
||||
@ -1089,7 +1083,6 @@ class Server {
|
||||
),
|
||||
assetPlugins,
|
||||
onProgress: null,
|
||||
unbundle: false,
|
||||
};
|
||||
}
|
||||
|
||||
@ -1126,15 +1119,12 @@ class Server {
|
||||
excludeSource: false,
|
||||
hot: false,
|
||||
inlineSourceMap: false,
|
||||
isolateModuleIDs: false,
|
||||
minify: false,
|
||||
onProgress: null,
|
||||
resolutionResponse: null,
|
||||
runBeforeMainModule: [],
|
||||
runModule: true,
|
||||
sourceMapUrl: null,
|
||||
type: 'script',
|
||||
unbundle: false,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,6 @@ function toServerOptions(options: Options): ServerOptions {
|
||||
hasteImplModulePath: options.hasteImplModulePath,
|
||||
maxWorkers: options.maxWorkers,
|
||||
minifierPath: options.minifierPath,
|
||||
moduleFormat: options.moduleFormat,
|
||||
platforms: options.platforms,
|
||||
polyfillModuleNames: options.polyfillModuleNames,
|
||||
postMinifyProcess: options.postMinifyProcess,
|
||||
|
@ -27,7 +27,6 @@ function buildBundle(
|
||||
...Server.DEFAULT_BUNDLE_OPTIONS,
|
||||
...requestOptions,
|
||||
bundleType: 'bundle',
|
||||
isolateModuleIDs: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,6 @@ async function buildBundle(
|
||||
...Server.DEFAULT_BUNDLE_OPTIONS,
|
||||
...requestOptions,
|
||||
bundleType: 'ram',
|
||||
isolateModuleIDs: true,
|
||||
};
|
||||
return await packagerClient.getRamBundleInfo(options);
|
||||
}
|
||||
|
@ -51,15 +51,12 @@ export type BundleOptions = {
|
||||
+excludeSource: boolean,
|
||||
+hot: boolean,
|
||||
+inlineSourceMap: boolean,
|
||||
+isolateModuleIDs: boolean,
|
||||
minify: boolean,
|
||||
onProgress: ?(doneCont: number, totalCount: number) => mixed,
|
||||
+platform: ?string,
|
||||
+resolutionResponse: ?{},
|
||||
+runBeforeMainModule: Array<string>,
|
||||
+runModule: boolean,
|
||||
sourceMapUrl: ?string,
|
||||
unbundle: boolean,
|
||||
createModuleIdFactory?: () => (path: string) => number,
|
||||
};
|
||||
|
||||
@ -96,7 +93,6 @@ export type Options = {|
|
||||
hasteImplModulePath?: string,
|
||||
maxWorkers?: number,
|
||||
minifierPath?: string,
|
||||
moduleFormat?: string,
|
||||
platforms?: Array<string>,
|
||||
polyfillModuleNames?: Array<string>,
|
||||
postMinifyProcess: PostMinifyProcess,
|
||||
|
Loading…
x
Reference in New Issue
Block a user