From 6d25da2d2b3a25bdfd2bdbb759484de653f32437 Mon Sep 17 00:00:00 2001 From: Futago-za Ryuu Date: Tue, 20 Mar 2018 03:21:58 +0000 Subject: [PATCH] Use bare option with browserify --- gulpfile.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index d3f2691..8ba0443 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -72,6 +72,14 @@ task( "build:parser", cb => { // Create the browser build. task( "build:browser", () => { + const options = { + + bare: true, + standalone: "peg", + suffix: ".min", + + }; + 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 ) .bundle() .pipe( source( "peg.js" ) ) .pipe( header( HEADER ) ) .pipe( gulp.dest( "browser" ) ) - .pipe( rename( { suffix: ".min" } ) ) + .pipe( rename( options ) ) .pipe( buffer() ) .pipe( uglify() ) .pipe( header( HEADER ) )