Skip to content

Commit

Permalink
new config metro.config.js 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
Wellerson committed Jun 30, 2019
1 parent 1eada13 commit 6cecaea
Show file tree
Hide file tree
Showing 3 changed files with 11,422 additions and 2 deletions.
22 changes: 21 additions & 1 deletion packages/app/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,29 @@
*/

const path = require('path');
const getWorkspaces = require('get-yarn-workspaces');
const workspaces = getWorkspaces(__dirname);
const blacklist = require('metro-config/src/defaults/blacklist');

module.exports = {
watchFolders: [path.resolve(__dirname, './node_modules')],
projectRoot: path.resolve(__dirname, '.'),
// watchFolders: [path.resolve(__dirname, './node_modules')],
watchFolders: [
path.resolve(__dirname, '../../node_modules'),
...workspaces,
],

resolver: {
blacklistRE: blacklist([
/node_modules\/.*\/node_modules\/react-native\/.*/,
]),

// https://github.com/facebook/metro/issues/1#issuecomment-453450709
extraNodeModules: new Proxy({}, {
get: (target, name) => path.join(process.cwd(), `node_modules/${name}`),
}),
},

transformer: {
getTransformOptions: async () => ({
transform: {
Expand Down
4 changes: 3 additions & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
"relay": "relay-compiler --src ./src --schema ./data/schema.graphql --language typescript --watchman false"
},
"dependencies": {
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/runtime": "^7.4.5",
"@types/hoist-non-react-statics": "^3.3.1",
"@types/react": "^16.8.22",
"@types/react-native": "^0.57.64",
"@types/react-relay": "^5.0.0",
"@types/relay-runtime": "^5.0.0",
"@types/styled-components": "^4.1.16",
"get-yarn-workspaces": "^1.0.2",
"hoist-non-react-statics": "^3.3.0",
"native-base": "^2.12.1",
"react": "^16.8.6",
Expand All @@ -29,11 +31,11 @@
"styled-components": "^4.3.2"
},
"devDependencies": {
"@babel/core": "^7.4.5",
"@types/jest": "^24.0.15",
"@types/react": "^16.8.22",
"@types/react-native": "^0.57.64",
"@types/react-test-renderer": "^16.8.2",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^24.8.0",
"babel-plugin-relay": "^5.0.0",
"graphql": "^14.4.0",
Expand Down
Loading

0 comments on commit 6cecaea

Please sign in to comment.