Files
pezkuwi-ui/packages/exampleReactNative/metro.config.js
T
Jaco Greeff b2ba6aa7ae Bumps
2020-04-07 21:56:19 +02:00

39 lines
1.3 KiB
JavaScript

// Copyright 2017-2020 @polkadot/example-reactnative authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
const path = require('path');
const getWorkspaces = require('get-yarn-workspaces');
const workspaces = getWorkspaces(__dirname).filter((item) =>
path.normalize(item) !== path.normalize(__dirname)
);
let workspacesBuildDirs = workspaces.map((workspace) => path.join(workspace, 'build/'));
workspacesBuildDirs = workspacesBuildDirs.filter((item) => item !== path.join(__dirname, '../reactnative-identicon/build/'));
module.exports = {
// remap node packages to react-native packages
resolver: {
extraNodeModules: {
crypto: require.resolve('react-native-crypto'),
os: require.resolve('os-browserify'),
process: require.resolve('process'),
stream: require.resolve('stream-http'),
vm: require.resolve('vm-browserify')
}
},
transformer: {
getTransformOptions: () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false
}
})
},
// watch other packages as well as root node_modules
watchFolders: [
path.resolve(__dirname, '../../node_modules'),
...workspacesBuildDirs
]
};