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 коммит произвёл facebook-github-bot-7
Родитель 12a68a8183
Коммит 144f8598c2
2 изменённых файлов: 31 добавлений и 0 удалений

Просмотреть файл

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

Просмотреть файл

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