- Apps and @mancala/core depend on the packages in this repo through link: dependencies instead of the npm releases, so changes no longer need a publish - Root package.json gets a build:packages script that installs and builds both packages - Backend and frontend Docker images are built from the repo root so they can include the packages; compose builds them that way - Metro watches the packages folder and resolves their imports from the app's node_modules
20 lines
653 B
JavaScript
20 lines
653 B
JavaScript
const path = require('path');
|
|
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
|
|
|
|
/**
|
|
* Metro configuration
|
|
* https://facebook.github.io/metro/docs/configuration
|
|
*
|
|
* @type {import('metro-config').MetroConfig}
|
|
*/
|
|
const config = {
|
|
// @mancala/core and mancala.js are linked from the repo's packages folder.
|
|
watchFolders: [path.resolve(__dirname, '../../packages')],
|
|
resolver: {
|
|
// Lets the linked packages find modules that only the app installs, such as @babel/runtime.
|
|
nodeModulesPaths: [path.resolve(__dirname, 'node_modules')],
|
|
},
|
|
};
|
|
|
|
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
|