mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
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:
committed by
facebook-github-bot-7
parent
12a68a8183
commit
144f8598c2
@@ -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')
|
||||
|
||||
27
local-cli/generator/templates/rn-cli.config.js
Normal file
27
local-cli/generator/templates/rn-cli.config.js
Normal 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;
|
||||
Reference in New Issue
Block a user