diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 92dab552..4ee70830 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -104,7 +104,6 @@ Given a set of options that you would typically pass to a server, plus a set of * `dev (boolean)`: optional boolean indicating if the bundle has to be built in development mode. Implies things like setting `__DEV__` to `true`. Defaults to `false`. * `entryFile (string)`: entry point for bundling the file. -* `generateSourceMaps (boolean)`: whether source Maps should be generated or not. Defaults to `false`. * `inlineSourceMap (boolean)`: indicates whether the source map is provided inlined with the bundle (as a bas64 encoded URL), or in a separate file. When provided as a separate file, the URL where it will be found can be customized with `sourceMapUrl`. Defaults to `false`. * `minify (boolean)`: whether code should be minified. Defaults to `false`. * `platform (string)`: if a list of platforms is provided, a particular platform can be passed. diff --git a/packages/metro/src/DeltaBundler/DeltaCalculator.js b/packages/metro/src/DeltaBundler/DeltaCalculator.js index 2fbf2e66..8154d079 100644 --- a/packages/metro/src/DeltaBundler/DeltaCalculator.js +++ b/packages/metro/src/DeltaBundler/DeltaCalculator.js @@ -161,7 +161,6 @@ class DeltaCalculator extends EventEmitter { const transformOptionsForBlacklist = { enableBabelRCLookup, dev: this._options.dev, - generateSourceMaps: this._options.generateSourceMaps, hot: this._options.hot, inlineRequires: false, minify: this._options.minify, diff --git a/packages/metro/src/DeltaBundler/__tests__/DeltaCalculator-test.js b/packages/metro/src/DeltaBundler/__tests__/DeltaCalculator-test.js index 3234072b..1db27239 100644 --- a/packages/metro/src/DeltaBundler/__tests__/DeltaCalculator-test.js +++ b/packages/metro/src/DeltaBundler/__tests__/DeltaCalculator-test.js @@ -43,7 +43,6 @@ describe('DeltaCalculator', () => { entryFile: 'bundle', entryModuleOnly: false, excludeSource: false, - generateSourceMaps: false, hot: true, inlineSourceMap: true, isolateModuleIDs: false, @@ -301,7 +300,6 @@ describe('DeltaCalculator', () => { expect(await deltaCalculator.getTransformerOptions()).toEqual({ dev: true, enableBabelRCLookup: false, - generateSourceMaps: false, hot: true, inlineRequires: false, minify: false, @@ -320,7 +318,6 @@ describe('DeltaCalculator', () => { expect(await deltaCalculator.getTransformerOptions()).toEqual({ dev: true, enableBabelRCLookup: false, - generateSourceMaps: false, hot: true, inlineRequires: true, minify: false, @@ -339,7 +336,6 @@ describe('DeltaCalculator', () => { expect(await deltaCalculator.getTransformerOptions()).toEqual({ dev: true, enableBabelRCLookup: false, - generateSourceMaps: false, hot: true, inlineRequires: {blacklist: {'/bar': true, '/baz': true}}, minify: false, diff --git a/packages/metro/src/HmrServer/getBundlingOptionsForHmr.js b/packages/metro/src/HmrServer/getBundlingOptionsForHmr.js index 14d34a6b..dbbad627 100644 --- a/packages/metro/src/HmrServer/getBundlingOptionsForHmr.js +++ b/packages/metro/src/HmrServer/getBundlingOptionsForHmr.js @@ -39,7 +39,6 @@ module.exports = function getBundlingOptionsForHmr( dev: true, entryModuleOnly: false, excludeSource: false, - generateSourceMaps: false, inlineSourceMap: false, isolateModuleIDs: false, onProgress: null, diff --git a/packages/metro/src/JSTransformer/worker/index.js b/packages/metro/src/JSTransformer/worker/index.js index b7e02a65..f38d3814 100644 --- a/packages/metro/src/JSTransformer/worker/index.js +++ b/packages/metro/src/JSTransformer/worker/index.js @@ -62,7 +62,6 @@ export type Transformer = { export type TransformOptionsStrict = {| +enableBabelRCLookup: boolean, +dev: boolean, - +generateSourceMaps: boolean, +hot: boolean, +inlineRequires: boolean, +minify: boolean, @@ -73,7 +72,6 @@ export type TransformOptionsStrict = {| export type TransformOptions = { +enableBabelRCLookup?: boolean, +dev?: boolean, - +generateSourceMaps?: boolean, +hot?: boolean, +inlineRequires: boolean, +minify: boolean, diff --git a/packages/metro/src/ModuleGraph/worker/__tests__/transform-module-test.js b/packages/metro/src/ModuleGraph/worker/__tests__/transform-module-test.js index 0ece169f..64b38488 100644 --- a/packages/metro/src/ModuleGraph/worker/__tests__/transform-module-test.js +++ b/packages/metro/src/ModuleGraph/worker/__tests__/transform-module-test.js @@ -87,7 +87,6 @@ describe('transforming JS modules:', () => { const defaults = { dev: false, - generateSourceMaps: true, hot: false, inlineRequires: false, minify: false, diff --git a/packages/metro/src/ModuleGraph/worker/transform-module.js b/packages/metro/src/ModuleGraph/worker/transform-module.js index 40a2d522..3738cdd0 100644 --- a/packages/metro/src/ModuleGraph/worker/transform-module.js +++ b/packages/metro/src/ModuleGraph/worker/transform-module.js @@ -49,7 +49,6 @@ export type TransformOptions = {| const NODE_MODULES = path.sep + 'node_modules' + path.sep; const defaultTransformOptions = { dev: false, - generateSourceMaps: true, hot: false, inlineRequires: false, minify: false, diff --git a/packages/metro/src/Server/__tests__/Server-test.js b/packages/metro/src/Server/__tests__/Server-test.js index 6c467984..606ca036 100644 --- a/packages/metro/src/Server/__tests__/Server-test.js +++ b/packages/metro/src/Server/__tests__/Server-test.js @@ -190,7 +190,6 @@ describe('processRequest', () => { entryFile: 'index.ios.js', entryModuleOnly: false, excludeSource: false, - generateSourceMaps: false, hot: true, inlineSourceMap: false, isolateModuleIDs: false, @@ -222,7 +221,6 @@ describe('processRequest', () => { entryFile: 'index.js', entryModuleOnly: false, excludeSource: false, - generateSourceMaps: false, hot: true, inlineSourceMap: false, isolateModuleIDs: false, @@ -254,7 +252,6 @@ describe('processRequest', () => { entryFile: 'index.js', entryModuleOnly: false, excludeSource: false, - generateSourceMaps: false, hot: true, inlineSourceMap: false, isolateModuleIDs: false, @@ -431,7 +428,6 @@ describe('processRequest', () => { entryFile: 'foo file', entryModuleOnly: false, excludeSource: false, - generateSourceMaps: false, hot: false, inlineSourceMap: false, isolateModuleIDs: false, diff --git a/packages/metro/src/Server/index.js b/packages/metro/src/Server/index.js index 853dd9f0..aabff411 100644 --- a/packages/metro/src/Server/index.js +++ b/packages/metro/src/Server/index.js @@ -250,7 +250,6 @@ class Server { +dev: boolean, +platform: string, +minify: boolean, - +generateSourceMaps: boolean, }): Promise> { const bundleOptions = { ...Server.DEFAULT_BUNDLE_OPTIONS, @@ -839,7 +838,6 @@ class Server { 'entryModuleOnly', false, ), - generateSourceMaps: false, assetPlugins, onProgress: null, unbundle: false, @@ -868,7 +866,6 @@ class Server { dev: true, entryModuleOnly: false, excludeSource: false, - generateSourceMaps: false, hot: false, inlineSourceMap: false, isolateModuleIDs: false, diff --git a/packages/metro/src/index.js b/packages/metro/src/index.js index 288e452d..eb330fb8 100644 --- a/packages/metro/src/index.js +++ b/packages/metro/src/index.js @@ -237,7 +237,6 @@ exports.runBuild = async (options: RunBuildOptions) => { const requestOptions: RequestOptions = { dev: options.dev, entryFile: options.entry, - generateSourceMaps: options.sourceMap || !!options.sourceMapUrl, inlineSourceMap: options.sourceMap && !!options.sourceMapUrl, minify: options.optimize || false, platform: options.platform || `web`, diff --git a/packages/metro/src/legacy.js b/packages/metro/src/legacy.js index c5cb7363..7f8421c3 100644 --- a/packages/metro/src/legacy.js +++ b/packages/metro/src/legacy.js @@ -43,7 +43,6 @@ type Options = {| type PublicBundleOptions = { +dev?: boolean, +entryFile: string, - +generateSourceMaps?: boolean, +inlineSourceMap?: boolean, +minify?: boolean, +platform?: string, @@ -72,11 +71,6 @@ function assertPublicBundleOptions(bo: mixed): PublicBundleOptions { typeof entryFile === 'string', 'bundle options must contain a string field `entryFile`', ); - invariant( - bo.generateSourceMaps === undefined || - typeof bo.generateSourceMaps === 'boolean', - 'bundle options field `generateSourceMaps` must be a boolean', - ); invariant( bo.inlineSourceMap === undefined || typeof bo.inlineSourceMap === 'boolean', 'bundle options field `inlineSourceMap` must be a boolean', @@ -125,7 +119,6 @@ exports.getOrderedDependencyPaths = async function( +dev: boolean, +platform: string, +minify: boolean, - +generateSourceMaps: boolean, }, ): Promise> { var server = createNonPersistentServer(options); diff --git a/packages/metro/src/lib/GlobalTransformCache.js b/packages/metro/src/lib/GlobalTransformCache.js index 6c2377da..a83aa082 100644 --- a/packages/metro/src/lib/GlobalTransformCache.js +++ b/packages/metro/src/lib/GlobalTransformCache.js @@ -440,7 +440,6 @@ class OptionsHasher { ): crypto$Hash { const { enableBabelRCLookup, - generateSourceMaps, dev, hot, inlineRequires, @@ -461,7 +460,6 @@ class OptionsHasher { hash.update( new Buffer([ +dev | - (+generateSourceMaps << 1) | (+hot << 2) | (+inlineRequires << 3) | (+enableBabelRCLookup << 4) | diff --git a/packages/metro/src/lib/__tests__/GlobalTransformCache-test.js b/packages/metro/src/lib/__tests__/GlobalTransformCache-test.js index 2a5d962d..3ae608ae 100644 --- a/packages/metro/src/lib/__tests__/GlobalTransformCache-test.js +++ b/packages/metro/src/lib/__tests__/GlobalTransformCache-test.js @@ -45,7 +45,6 @@ describe('GlobalTransformCache', () => { storeResults: null, }); const transformOptions = { - generateSourceMaps: false, dev: false, hot: false, inlineRequires: false, diff --git a/packages/metro/src/shared/types.flow.js b/packages/metro/src/shared/types.flow.js index 2b219e5f..c389cb37 100644 --- a/packages/metro/src/shared/types.flow.js +++ b/packages/metro/src/shared/types.flow.js @@ -34,7 +34,6 @@ export type BundleOptions = { entryFile: string, +entryModuleOnly: boolean, +excludeSource: boolean, - +generateSourceMaps: boolean, +hot: boolean, +inlineSourceMap: boolean, +isolateModuleIDs: boolean, @@ -109,7 +108,6 @@ export type OutputOptions = { export type RequestOptions = {| entryFile: string, - generateSourceMaps?: boolean, inlineSourceMap?: boolean, sourceMapUrl?: string, dev?: boolean,