[react-packager] dev option needs to default to true for backwards compat
This commit is contained in:
parent
9e2bdede15
commit
b9207a3095
|
@ -196,7 +196,7 @@ function getOptionsFromUrl(reqUrl) {
|
|||
return {
|
||||
sourceMapUrl: urlObj.pathname.replace(/\.bundle$/, '.map'),
|
||||
main: main,
|
||||
dev: getBoolOptionFromQuery(urlObj.query, 'dev'),
|
||||
dev: getBoolOptionFromQuery(urlObj.query, 'dev', true),
|
||||
minify: getBoolOptionFromQuery(urlObj.query, 'minify'),
|
||||
runModule: getBoolOptionFromQuery(urlObj.query, 'runModule') ||
|
||||
// Backwards compatibility.
|
||||
|
@ -206,7 +206,11 @@ function getOptionsFromUrl(reqUrl) {
|
|||
};
|
||||
}
|
||||
|
||||
function getBoolOptionFromQuery(query, opt) {
|
||||
function getBoolOptionFromQuery(query, opt, defaultVal) {
|
||||
if (query[opt] == null && defaultVal != null) {
|
||||
return defaultVal;
|
||||
}
|
||||
|
||||
return query[opt] === 'true' || query[opt] === '1';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue