Skip to content

Commit

Permalink
Merge branch 'release/0.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
matejsvajger committed Aug 3, 2017
2 parents 7f89480 + 808ad89 commit 1c2a965
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "laravel-mix-pug",
"version": "0.1.0",
"version": "0.1.2",
"description": "Laravel Mix Plugin for compiling Pug/Jade templates.",
"main": "index.js",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand Down
8 changes: 4 additions & 4 deletions src/MixPugTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MixPugTask extends Task {
this.seedPath = options.seeds;
this.locals = options.locals || {};

this.updateSeeder();
this.seeder = this.createSeeder();

// Prepare Template Files
this.templates = files;
Expand Down Expand Up @@ -88,8 +88,8 @@ class MixPugTask extends Task {
* Updates seeder with changed data files
*
*/
updateSeeder() {
this.seeder = new PugSeeder(this.seedPath)
createSeeder() {
return new PugSeeder(this.seedPath)
.extend(this.locals);
}

Expand All @@ -99,7 +99,7 @@ class MixPugTask extends Task {
* @param {string} updatedFile
*/
onChange(updatedFile) {

this.seeder = this.createSeeder();
this.compile();
}

Expand Down
1 change: 1 addition & 0 deletions src/PugSeeder.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class PugSeeder {
*/
extend(data) {
this.locals = _.extend(this.locals, data);
return this;
}

}
Expand Down

0 comments on commit 1c2a965

Please sign in to comment.