Permalink
Browse files

Fix loading minified bundle over HTTP

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 09072b9d777d5961b1659002402fd7c4c91a0d82
@@ -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',
@@ -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(
@@ -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,
};
}

0 comments on commit 09072b9

Please sign in to comment.