chore: fix listing packages in metro config

This commit is contained in:
Satyajit Sahoo
2020-12-03 01:00:28 +01:00
parent 26074a28f7
commit 47f28558d6

View File

@@ -8,12 +8,15 @@ const blacklist = require('metro-config/src/defaults/blacklist');
const root = path.resolve(__dirname, '..'); const root = path.resolve(__dirname, '..');
const packages = path.resolve(root, 'packages'); const packages = path.resolve(root, 'packages');
// List all packages under `packages/`
const workspaces = fs const workspaces = fs
// List all packages under `packages/`
.readdirSync(packages) .readdirSync(packages)
// Ignore hidden files such as .DS_Store .map((p) => path.join(packages, p))
.filter((p) => !p.startsWith('.')) .filter(
.map((p) => path.join(packages, p)); (p) =>
fs.statSync(p).isDirectory() &&
fs.existsSync(path.join(p, 'package.json'))
);
// Get the list of dependencies for all packages in the monorepo // Get the list of dependencies for all packages in the monorepo
const modules = ['@expo/vector-icons'] const modules = ['@expo/vector-icons']