From 27d8346e2a7447e124c8689158b943db6a84dcc7 Mon Sep 17 00:00:00 2001 From: Yonatan Schreiber Date: Sat, 4 Apr 2015 15:29:03 +0300 Subject: [PATCH 1/2] fix appname bug --- app/index.js | 3 ++- main/index.js | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) 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() { From 2869169b7b76e536089a386b9def1727412de308 Mon Sep 17 00:00:00 2001 From: yonatanmn Date: Sat, 4 Apr 2015 16:11:26 +0300 Subject: [PATCH 2/2] Update index.js --- main/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/main/index.js b/main/index.js index 0dfb66f..d28ad0d 100644 --- a/main/index.js +++ b/main/index.js @@ -11,6 +11,7 @@ util.inherits(MainGenerator, ScriptBase); MainGenerator.prototype.createAppFile = function createAppFile(scriptAppName) { this.reactRouter = this.env.options.reactRouter; + this.scriptAppName = scriptAppName; this.appTemplate('App', 'components/' + scriptAppName); this.testTemplate('spec/App', 'components/' + scriptAppName); };