From 144f8598c2eee4987d77d726760299eeb7b3bacf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Bigio?= Date: Mon, 12 Oct 2015 16:49:07 -0700 Subject: [PATCH] Introduce configuration template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: @​public We're rolling out a replacement for `local-cli`. As part of the process we moved many hardcoded values into a JS based configuration file. Reviewed By: @vjeux Differential Revision: D2533111 fb-gh-sync-id: 7250bddee9989b089ded409104e098ef15d79498 --- local-cli/generator/index.js | 4 +++ .../generator/templates/rn-cli.config.js | 27 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 local-cli/generator/templates/rn-cli.config.js diff --git a/local-cli/generator/index.js b/local-cli/generator/index.js index 5e11dec0b9..3004ba2035 100644 --- a/local-cli/generator/index.js +++ b/local-cli/generator/index.js @@ -40,6 +40,10 @@ module.exports = yeoman.generators.NamedBase.extend({ { 'Libraries\/react-native\/react-native-interface.js' : 'node_modules/react-native/Libraries/react-native/react-native-interface.js' } ); + this.fs.copy( + this.templatePath('rn-cli.config.js'), + this.destinationPath('rn-cli.config.js') + ); this.fs.copy( this.templatePath('_gitignore'), this.destinationPath('.gitignore') diff --git a/local-cli/generator/templates/rn-cli.config.js b/local-cli/generator/templates/rn-cli.config.js new file mode 100644 index 0000000000..65ce495479 --- /dev/null +++ b/local-cli/generator/templates/rn-cli.config.js @@ -0,0 +1,27 @@ +'use strict'; + +var blacklist = require('./node_modules/react-native/packager/blacklist'); + +var config = { + getProjectRoots() { + return this._getRoots(); + }, + + getAssetRoots() { + return this._getRoots(); + }, + + getBlacklistRE() { + return blacklist(''); + }, + + getTransformModulePath() { + return require.resolve('./node_modules/react-native/packager/transformer'); + }, + + _getRoots() { + return [__dirname]; + } +}; + +module.exports = config;