Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const options = {
platform: args.platform,
entryFile: relativePath,
dev: args.dev,
minify: false,
generateSourceMaps: !args.dev,
};
const writeToFile = args.output;
const outStream = writeToFile
? fs.createWriteStream(args.output)
: process.stdout;
const deps = packagerInstance
? await packagerInstance.getOrderedDependencyPaths(options)
: await Metro.getOrderedDependencyPaths(config, options);
deps.forEach(modulePath => {
// Temporary hack to disable listing dependencies not under this directory.
// Long term, we need either
// (a) JS code to not depend on anything outside this directory, or
// (b) Come up with a way to declare this dependency in Buck.
const isInsideProjectRoots =
config.watchFolders.filter(root => modulePath.startsWith(root)).length >
0;
if (isInsideProjectRoots) {
outStream.write(`${modulePath}\n`);
}
});
return writeToFile
? denodeify(outStream.end).bind(outStream)()
const options = {
platform: args.platform,
entryFile: relativePath,
dev: args.dev,
minify: false,
generateSourceMaps: !args.dev,
};
const writeToFile = args.output;
const outStream = writeToFile
? fs.createWriteStream(args.output)
: process.stdout;
const deps = packagerInstance
? await packagerInstance.getOrderedDependencyPaths(options)
: await Metro.getOrderedDependencyPaths(config, options);
deps.forEach(modulePath => {
// Temporary hack to disable listing dependencies not under this directory.
// Long term, we need either
// (a) JS code to not depend on anything outside this directory, or
// (b) Come up with a way to declare this dependency in Buck.
const isInsideProjectRoots =
config.watchFolders.filter(root => modulePath.startsWith(root)).length >
0;
if (isInsideProjectRoots) {
outStream.write(`${modulePath}\n`);
}
});
return writeToFile
? denodeify(outStream.end).bind(outStream)()