Use bare option with browserify

master
Futago-za Ryuu 6 years ago
parent 126a4c95f4
commit 6d25da2d2b

@ -72,6 +72,14 @@ task( "build:parser", cb => {
// Create the browser build. // Create the browser build.
task( "build:browser", () => { task( "build:browser", () => {
const options = {
bare: true,
standalone: "peg",
suffix: ".min",
};
const HEADER = dedent` const HEADER = dedent`
/** /**
@ -88,13 +96,13 @@ task( "build:browser", () => {
`; `;
return browserify( "lib/peg.js", { standalone: "peg" } ) return browserify( "lib/peg.js", options )
.transform( babelify ) .transform( babelify )
.bundle() .bundle()
.pipe( source( "peg.js" ) ) .pipe( source( "peg.js" ) )
.pipe( header( HEADER ) ) .pipe( header( HEADER ) )
.pipe( gulp.dest( "browser" ) ) .pipe( gulp.dest( "browser" ) )
.pipe( rename( { suffix: ".min" } ) ) .pipe( rename( options ) )
.pipe( buffer() ) .pipe( buffer() )
.pipe( uglify() ) .pipe( uglify() )
.pipe( header( HEADER ) ) .pipe( header( HEADER ) )

Loading…
Cancel
Save