From 188b523629286c7751d317e6a3fbb0dfb72ba72b Mon Sep 17 00:00:00 2001 From: Emil Stenberg Date: Wed, 10 Dec 2014 10:42:06 +0100 Subject: [PATCH] passing es6 option to template --- app/index.js | 4 +++- templates/common/_webpack.config.js | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/index.js b/app/index.js index 3be315c..a42f9d3 100644 --- a/app/index.js +++ b/app/index.js @@ -7,6 +7,7 @@ var generalUtils = require('../util.js'); var ReactWebpackGenerator = module.exports = function ReactWebpackGenerator(args, options, config) { yeoman.generators.Base.apply(this, arguments); this.option('es6'); + // this.es6 = this.options.es6; this.argument('appname', { type: String, required: false }); this.appname = this.appname || path.basename(process.cwd()); @@ -95,10 +96,11 @@ ReactWebpackGenerator.prototype.createIndexHtml = function createIndexHtml() { }; ReactWebpackGenerator.prototype.packageFiles = function () { + this.es6 = this.options.es6; this.reactRouter = this.env.options.reactRouter; this.stylesLanguage = this.env.options.stylesLanguage; this.template('../../templates/common/_package.json', 'package.json'); - this.template('../../templates/common/_webpack.config.js', 'webpack.config.js'); + this.template('../../templates/common/_webpack.config.js', 'webpack.config.js', this, {es6:true}); this.template('../../templates/common/_webpack.dist.config.js', 'webpack.dist.config.js'); this.copy('../../templates/common/Gruntfile.js', 'Gruntfile.js'); this.copy('../../templates/common/gitignore', '.gitignore'); diff --git a/templates/common/_webpack.config.js b/templates/common/_webpack.config.js index d9856e5..4657cba 100644 --- a/templates/common/_webpack.config.js +++ b/templates/common/_webpack.config.js @@ -4,7 +4,6 @@ * This file is set up for serving the webpak-dev-server, which will watch for changes and recompile as required if * the subfolder /webpack-dev-server/ is visited. Visiting the root will not automatically reload. */ - 'use strict'; var webpack = require('webpack');