mirror of https://github.com/status-im/metro.git
[react-packager] dev option needs to default to true for backwards compat
This commit is contained in:
parent
3d92dd422c
commit
50220f1384
|
@ -196,7 +196,7 @@ function getOptionsFromUrl(reqUrl) {
|
||||||
return {
|
return {
|
||||||
sourceMapUrl: urlObj.pathname.replace(/\.bundle$/, '.map'),
|
sourceMapUrl: urlObj.pathname.replace(/\.bundle$/, '.map'),
|
||||||
main: main,
|
main: main,
|
||||||
dev: getBoolOptionFromQuery(urlObj.query, 'dev'),
|
dev: getBoolOptionFromQuery(urlObj.query, 'dev', true),
|
||||||
minify: getBoolOptionFromQuery(urlObj.query, 'minify'),
|
minify: getBoolOptionFromQuery(urlObj.query, 'minify'),
|
||||||
runModule: getBoolOptionFromQuery(urlObj.query, 'runModule') ||
|
runModule: getBoolOptionFromQuery(urlObj.query, 'runModule') ||
|
||||||
// Backwards compatibility.
|
// 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';
|
return query[opt] === 'true' || query[opt] === '1';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue