Skip to content

When used with require-globify cache is not invalidated properly #34

@futpib

Description

@futpib

capaj/require-globify lets you write code like

// index.js
const templates = require('./templates/*', { mode: 'hash' });

which at some point expands into

var templates = {
    'a': require('./template/a.html'),
    'b': require('./template/b.html')
};

When used with browserify-incremental index.js is not rebuilt after contents of the template directory change (like adding or removing a file).

My build script looks like this

// gulpfile.js
var b = browserify(_.defaults({
    entries: entries,
    debug: true
}, browserifyInc.args));

b.transform('require-globify');

browserifyInc(b, {
    cacheFile: './.browserify-incremental-cache.json'
});

Maybe there is a way to make browserify-incremental kick in after require-globify transform?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions