Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-contamination when running multiple gulp tasks that use gulp-hb #29

Closed
gligoran opened this issue Jan 24, 2016 · 5 comments
Closed
Assignees
Milestone

Comments

@gligoran
Copy link

I'm using gulp-hp to build email templates. For each template I build 2 a text version and an html version. To make this work, I have 2 sets of partials. One for each version. In order for the core templates to work with both sets, the partials need to have the same names.

I've set up gulp watch, so I don't need to run the tasks manually. If I change any of the core templates, both tasks trigger. At almost the same time. The problem is that the one that started second (by a few milliseconds), will overwrite the partials, and I end up with both versions of the templates being the same.

The cause of this seems to be, the glup-hb registers the partials and the helpers globally. The task that started first loads its partials, but then the other tasks loads its partials, overwriting those of the first task. The end result is that first tasks will render templates using the partials of the second task.

I think each task, and in turn each call to .pipe(hb(...)), should have its own set of registered partials, helpers...

@shannonmoeller shannonmoeller added this to the v2.7.x milestone Feb 3, 2016
@shannonmoeller
Copy link
Owner

This is a good idea. Would likely address #24 as well.

@shannonmoeller
Copy link
Owner

I have a v3 release candidate ready that should address this issue. Are you available to kick the tires?

npm i --save "shannonmoeller/gulp-hb#v3"

@shannonmoeller shannonmoeller self-assigned this Feb 12, 2016
@shannonmoeller
Copy link
Owner

Released as v3.0.0

@gligoran
Copy link
Author

Sorry, for being late to the party. It works like a charm now. More gulp watch parallelization for me :)

@shannonmoeller
Copy link
Owner

Thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants