by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Zac Evans
    @pixelmaven
    I actually had that originally, saw it used like ^ so gave it a go, both ways seem to work when running the task directly
    Shannon Moeller
    @shannonmoeller
    My first thought is that the way I'm requiring modules might not be meshing the the base option of the gulp.src call.
    second possibility is with how gulp watch fires off the subprocess.
    Meshing with^^
    Zac Evans
    @pixelmaven
    ah, right. without the base the dest doesn't seem to retain folder structure as per usual.
    Shannon Moeller
    @shannonmoeller
    I'll setup a test case locally and see if I can replicate the issue. Are you on windows or *nix?
    Zac Evans
    @pixelmaven
    osx
    Zac Evans
    @pixelmaven
    ok, so I think i've isolated it to the fact that i had a browserify transform for hbsfy on my package.json - I just cant figure out how this would affect my tpl task
    Shannon Moeller
    @shannonmoeller
    Oh, interesting.
    The instances of handlebars would likely conflict in that case.
    When you run the task directly, does it also run your browserify task?
    Zac Evans
    @pixelmaven
    Right, i could totally understand they would conflict if used at the same time. I assumed that the tasks wouldn't pollute each others dependencies like that.
    Shannon Moeller
    @shannonmoeller
    can you setup something like gulp.task(’both’, [‘js’, ’tpl’]); and see if running gulp both also causes the error?
    Zac Evans
    @pixelmaven
    hah, that works totally fine
    Shannon Moeller
    @shannonmoeller
    So either it’s a different issue or we’re fighting a race condition.
    Zac Evans
    @pixelmaven

    it's bizarre, i run gulp watch with

    gulp.task('watch', function() {
        gulp.watch( paths.src.tpl + '**/*.hbs', ['both'] );
    });

    and it still compiles fine

    Shannon Moeller
    @shannonmoeller
    Are you using handlebars-layouts in your hbsfy-ed templates?
    Nevermind. That would throw an error in the client, not node.
    Zac Evans
    @pixelmaven
    I'm not actually requiring any templates into browserify yet, just the fact that the hbsfy browserify transform exists in package.json is causing the issue.
    Shannon Moeller
    @shannonmoeller
    I setup a demo repo. That’s working for me as expected when I run any of the tasks.
    @pixelmaven ^
    Zac Evans
    @pixelmaven
    ah brilliant! I'll check it out.
    Right, makes sense to have the hbsfy transform within the task
    That's awesome, thanks for doing that
    Shannon Moeller
    @shannonmoeller
    I try to avoid putting anything module-specific in package.json if I can help it.
    Let me know how it goes! If I really have a bug, I’d love to squash it.
    Zac Evans
    @pixelmaven
    Haha will do, really appreciate the assistance
    Shannon Moeller
    @shannonmoeller
    my pleasure
    Zac Evans
    @pixelmaven
    @shannonmoeller Working well mate! The overall goal here is for me to get assemble like functionality with gulp-hb, I’ve managed to get the core idea working well - What would be your first thoughts in replicating the {{#each pages}} functionality - ive tried loading in the handlebars-helpers/**/helpers-files.js - but that seems to have a hard dependency on grunt.
    Shannon Moeller
    @shannonmoeller
    Glad to hear it! Looks like they're requiring grunt in that helper without actually using it. I'd grab the file, remove the reference to grunt, and give it another go.
    Generally I'd also recommend submitting an issue for them to remove it, but I know the assemble team is hard at work wrapping up a big refactor for assemble 1.0. That includes a rework of the helpers repo.
    Zac Evans
    @pixelmaven
    I did try that, to no avail, I think the dependency tree is a bit deeper for grunt. It requires utils which also requires grunt and so on.. Figured I should avoid that rabbit hole.
    I originally checked out gulp-assemble but couldn't get that running
    Shannon Moeller
    @shannonmoeller
    If you think you’re going to need some of the more advanced features of Assemble, I recommend that you check out the v0.6.0 branch. Once complete, that branch will be released as 1.0. It’s a huge improvement over the original grunt-based tool.
    Shannon Moeller
    @shannonmoeller
    If you’d like to continue using gulp-hb (which would be awesome), I’d recommend creating a JS file that generates your project-wide data, including nav trees etc.
    I’ll add another example into the demo repo.
    Zac Evans
    @pixelmaven
    Hi @shannonmoeller, I think your definitely onto something with gulp-hb - so happy to keep using it, it’s being used for a rather large project, just need to lock down a few key functionalities then I think it’s a no brainer.
    Shannon Moeller
    @shannonmoeller
    @pixelmaven Just updated the demo with a (quick and dirty) example of generating page data.
    Zac Evans
    @pixelmaven
    amazing!
    that’s perfect
    Zac Evans
    @pixelmaven
    I was struggling to figure that part out, so thanks again @shannonmoeller! saved my ass again!
    Shannon Moeller
    @shannonmoeller
    @pixelmaven Fixed a couple issues with the demo.
    Thanks for the interaction. Putting the demo together helped me think through an issue on another project.
    huytiki
    @huytiki
    Hi huys
    Hi guys
    Anybody can tell me how to load data from file please.
    gulp.task('tpl', function () {
    var hbStream = hb()
    .partials('./templates/assets/partials/.{hbs,js}')
    .partials('./templates/assets/partials/components/
    .{hbs,js}')
    .partials('./templates/assets/partials/layouts/.{hbs,js}')
    .data('./templates/assets/data/
    .{js,json}')
    .data({
    icon: "icon.png",
    });;
    return gulp
    .src('./templates/{,/*}.html')
    .pipe(hbStream)
    .pipe(gulp.dest('./build'));
    });
    My code can't load data from file :(