Skip to content

Commit

Permalink
Rewrite the package JSON and fix to the last working webpack version. #…
Browse files Browse the repository at this point in the history
  • Loading branch information
stylesuxx committed Nov 15, 2016
1 parent 1e0ac65 commit ff43cc0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions generators/root/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const generator = require('yeoman-generator');
const fs = require('fs');

module.exports = generator.Base.extend({

Expand All @@ -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
Expand Down

0 comments on commit ff43cc0

Please sign in to comment.