diff --git a/generators/root/index.js b/generators/root/index.js index ab75b02..991975a 100644 --- a/generators/root/index.js +++ b/generators/root/index.js @@ -1,4 +1,5 @@ const generator = require('yeoman-generator'); +const fs = require('fs'); module.exports = generator.Base.extend({ @@ -7,6 +8,17 @@ module.exports = generator.Base.extend({ this.argument('name', { type: String, required: true }); }, + conflicts: function configuring() { + // Rewrite the webpack version the the last know working beta version + // It is left here in plain sight, to remind about the pain updating to + // a master branch without checking for the actual version. + // + // TODO: throw this out as soon as the next stable version is released + var config = JSON.parse(fs.readFileSync(this.destinationPath('package.json'))); + config.devDependencies.webpack = '=2.1.0-beta.6'; + fs.writeFileSync(this.destinationPath('package.json'), JSON.stringify(config)); + }, + writing: function writing() { /* Some base functionality needs to be overwritten, so we force yeoman to do * so. This is not the nicest thing to do, but since this changes are needed