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

Add Gulp-Remember Into Bundle Flow #51

Open
smschrader opened this issue Mar 19, 2015 · 3 comments
Open

Add Gulp-Remember Into Bundle Flow #51

smschrader opened this issue Mar 19, 2015 · 3 comments
Milestone

Comments

@smschrader
Copy link

Adding the ability to configure/enable gulp-remember will help make large bundles faster during development.

@chmontgomery
Copy link
Contributor

Adding gulp-remember is already possible to the main bundle task, e.g.:

gulp.task('lessMain', function() {  
    return gulp.src(projectPaths.cssMainConfig)        
        .pipe(cache('less'))
        .pipe(remember('less'))
        .pipe(bundle())        
        .pipe(bundle.results({
            fileName: 'main.result',
            dest: projectPaths.cssResults,
            pathPrefix: '<%=request.getContextPath()%>/dist/styles/'
        }))        
        .pipe(gulp.dest(projectPaths.cssDist));
});

However, an enhancement needs to be added to gbundle.watch to allow actions to run on change. I'm thinking of a config option like so:

gbundle.watch({
    configPath: path.join(__dirname, 'bundle.config.js'),
    results: {
      dest: __dirname,
      pathPrefix: '/public/',
      fileName: 'manifest'
    },
    dest: path.join(__dirname, 'public'),
    onChange: function (event) { // custom on change event handler
        if (event.type === 'deleted') {
            delete cache.caches['scripts'][event.path];
            remember.forget('scripts', event.path);
        }
    }
});

How does that sound?

@smschrader
Copy link
Author

@chmontgomery I like that, simple enough!

@timelf123
Copy link

That looks like a great addition to the API. Some of my bundles/copy tasks are pretty hefty

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

No branches or pull requests

3 participants