Skip to content

Commit

Permalink
Fix loading minified bundle over HTTP
Browse files Browse the repository at this point in the history
Summary: Sets `generateSourceMaps` to true when requesting a bundle in non-dev mode or minified.

Reviewed By: bestander, cpojer

Differential Revision: D4415492

fbshipit-source-id: 9b4dcbd577a535dab143bb7a067210fbd831bf1a
  • Loading branch information
davidaurelio authored and facebook-github-bot committed Jan 13, 2017
1 parent 9a4e4e8 commit 09072b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Expand Up @@ -442,7 +442,7 @@ describe('processRequest', () => {
entryFile: 'path/to/foo.js',
inlineSourceMap: false,
minify: false,
generateSourceMaps: false,
generateSourceMaps: true,
hot: false,
runModule: false,
sourceMapUrl: '/path/to/foo.map?dev=false&runModule=false',
Expand Down
8 changes: 5 additions & 3 deletions packager/react-packager/src/Server/index.js
Expand Up @@ -926,11 +926,13 @@ class Server {
assetPlugin :
(typeof assetPlugin === 'string') ? [assetPlugin] : [];

const dev = this._getBoolOptionFromQuery(urlObj.query, 'dev', true);
const minify = this._getBoolOptionFromQuery(urlObj.query, 'minify', false);
return {
sourceMapUrl: url.format(sourceMapUrlObj),
entryFile: entryFile,
dev: this._getBoolOptionFromQuery(urlObj.query, 'dev', true),
minify: this._getBoolOptionFromQuery(urlObj.query, 'minify', false),
dev,
minify,
hot: this._getBoolOptionFromQuery(urlObj.query, 'hot', false),
runModule: this._getBoolOptionFromQuery(urlObj.query, 'runModule', true),
inlineSourceMap: this._getBoolOptionFromQuery(
Expand All @@ -944,7 +946,7 @@ class Server {
'entryModuleOnly',
false,
),
generateSourceMaps: this._getBoolOptionFromQuery(urlObj.query, 'babelSourcemap', false),
generateSourceMaps: minify || !dev || this._getBoolOptionFromQuery(urlObj.query, 'babelSourcemap', false),
assetPlugins,
};
}
Expand Down

0 comments on commit 09072b9

Please sign in to comment.