Sitelet https://github.com/browserify/bundle-collapser/issues/21
Skip to content

Please, provide example of how to use with browserify #21

Description

@blaasvaer

I have code that look like this:

( ... )
var collapse = require('bundle-collapser');
( ... )
var b = browserify({
	entries: admin_app_src,
	cache: {},
	packageCache: {},
	plugin: [watchify]
}).transform('babelify', { "presets" : ["latest"] });
( ... )
function bundle() {
	return b.bundle()
		( ... )
		.pipe( collapse() ) // <-- this does not work
		( ... )
		.pipe( source('build.js') )
		( ... )
		.pipe( buffer() )
		( ... )
		.pipe( uglify() )
		( ... )
		.pipe(gulp.dest('./assets/js'));
}

I can't seem to get bundle-collapser to work, no matter how I try to »implement« it – either as a plugin or in the pipeline.

Could you please provide an example of how to do this?

My problem seems to be how to pass the stream into the collapser ...

Also tried:

( ... )
}).transform('collapse', 'babelify', { "presets" : ["latest"] });

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions