mirror of
https://github.com/status-im/metro.git
synced 2025-01-20 07:59:12 +00:00
add --dev flag to the packager's dependencies command
Summary: The packager dependencies CLI command always operates on --dev=true today. This means any tooling that needs to get the production dependencies (--dev=false) will always get the dev-mode list instead. For instance: ``` if (__DEV__) { require('Foobar'); } ``` Previously, `Foobar.js` will always be listed in the CLI output. With this change, setting `--dev false` option will correctly skip `Foobar.js` in the output. Reviewed By: cpojer Differential Revision: D5163184 fbshipit-source-id: 203221ee5d6ecb7df575442f12f6c4c489bfbd46
This commit is contained in:
parent
7974a5b745
commit
de70d376ca
@ -596,12 +596,14 @@ class Bundler {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
getOrderedDependencyPaths({entryFile, dev, platform}: {
|
getOrderedDependencyPaths({entryFile, dev, platform, minify, generateSourceMaps}: {
|
||||||
+entryFile: string,
|
+entryFile: string,
|
||||||
+dev: boolean,
|
+dev: boolean,
|
||||||
+platform: string,
|
+platform: string,
|
||||||
|
+minify: boolean,
|
||||||
|
+generateSourceMaps: boolean,
|
||||||
}) {
|
}) {
|
||||||
return this.getDependencies({entryFile, dev, platform}).then(
|
return this.getDependencies({entryFile, dev, platform, minify, generateSourceMaps}).then(
|
||||||
({dependencies}) => {
|
({dependencies}) => {
|
||||||
const ret = [];
|
const ret = [];
|
||||||
const promises = [];
|
const promises = [];
|
||||||
|
@ -319,6 +319,8 @@ class Server {
|
|||||||
+entryFile: string,
|
+entryFile: string,
|
||||||
+dev: boolean,
|
+dev: boolean,
|
||||||
+platform: string,
|
+platform: string,
|
||||||
|
+minify: boolean,
|
||||||
|
+generateSourceMaps: boolean,
|
||||||
}): Promise<mixed> {
|
}): Promise<mixed> {
|
||||||
return Promise.resolve().then(() => {
|
return Promise.resolve().then(() => {
|
||||||
return this._bundler.getOrderedDependencyPaths(options);
|
return this._bundler.getOrderedDependencyPaths(options);
|
||||||
|
@ -92,6 +92,8 @@ exports.getOrderedDependencyPaths = function(options: Options, depOptions: {
|
|||||||
+entryFile: string,
|
+entryFile: string,
|
||||||
+dev: boolean,
|
+dev: boolean,
|
||||||
+platform: string,
|
+platform: string,
|
||||||
|
+minify: boolean,
|
||||||
|
+generateSourceMaps: boolean,
|
||||||
}) {
|
}) {
|
||||||
var server = createNonPersistentServer(options);
|
var server = createNonPersistentServer(options);
|
||||||
return server.getOrderedDependencyPaths(depOptions)
|
return server.getOrderedDependencyPaths(depOptions)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user