diff --git a/local-cli/generator-utils.js b/local-cli/generator-utils.js index e44f9f0da..9f58f2e53 100644 --- a/local-cli/generator-utils.js +++ b/local-cli/generator-utils.js @@ -19,7 +19,7 @@ function copyAndReplace(src, dest, replacements) { } else { var content = fs.readFileSync(src, 'utf8'); Object.keys(replacements).forEach(function(regex) { - content = content.replace(new RegExp(regex, 'g'), replacements[regex]); + content = content.replace(new RegExp(regex, 'gm'), replacements[regex]); }); fs.writeFileSync(dest, content); } diff --git a/local-cli/generator/index.js b/local-cli/generator/index.js index 90f08912a..79a7a1936 100644 --- a/local-cli/generator/index.js +++ b/local-cli/generator/index.js @@ -50,7 +50,10 @@ module.exports = yeoman.generators.NamedBase.extend({ utils.copyAndReplace( this.templatePath('../../../.flowconfig'), this.destinationPath('.flowconfig'), - { 'Libraries\/react-native\/react-native-interface.js' : 'node_modules/react-native/Libraries/react-native/react-native-interface.js' } + { + 'Libraries\/react-native\/react-native-interface.js' : 'node_modules/react-native/Libraries/react-native/react-native-interface.js', + '^flow/$' : 'node_modules/react-native/flow\nflow/' + } ); this.fs.copy( diff --git a/package.json b/package.json index 7e14ab46a..e73aec5d8 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,8 @@ "PATENTS", "README.md", "jestSupport", - ".flowconfig" + ".flowconfig", + "flow" ], "scripts": { "test": "NODE_ENV=test jest",