Introduce configuration template

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
This commit is contained in:
Martín Bigio 2015-10-12 16:49:07 -07:00 committed by facebook-github-bot-7
parent 12a68a8183
commit 144f8598c2
2 changed files with 31 additions and 0 deletions

View File

@ -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')

View File

@ -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;