diff --git a/app/index.js b/app/index.js index 818167f..c434b3f 100644 --- a/app/index.js +++ b/app/index.js @@ -15,7 +15,6 @@ var ReactWebpackGenerator = module.exports = function ReactWebpackGenerator(args this.config.set('app-name', this.appname); - args = ['main']; if (typeof this.options.appPath === 'undefined') { this.options.appPath = this.options.appPath || 'src'; @@ -23,6 +22,8 @@ var ReactWebpackGenerator = module.exports = function ReactWebpackGenerator(args this.appPath = this.options.appPath; + args = [this.scriptAppName]; + this.composeWith('react-webpack:common', { args: args }); diff --git a/main/index.js b/main/index.js index 6ccbb28..0dfb66f 100644 --- a/main/index.js +++ b/main/index.js @@ -9,10 +9,10 @@ var MainGenerator = module.exports = function MainGenerator(args, options, confi util.inherits(MainGenerator, ScriptBase); -MainGenerator.prototype.createAppFile = function createAppFile() { +MainGenerator.prototype.createAppFile = function createAppFile(scriptAppName) { this.reactRouter = this.env.options.reactRouter; - this.appTemplate('App', 'components/' + this.scriptAppName); - this.testTemplate('spec/App', 'components/' + this.scriptAppName); + this.appTemplate('App', 'components/' + scriptAppName); + this.testTemplate('spec/App', 'components/' + scriptAppName); }; MainGenerator.prototype.createMainFile = function createMainFile() {