🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

@john-yuan/dev-browserify-builder

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@john-yuan/dev-browserify-builder

An util to build and minify browserify bundle.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Browserify Builder

A dev-tool to bundle the javascript file and its dependencies with browserify and minify the result code with uglify-js.

Install

npm i @john-yuan/dev-browserify-builder

Usage

var builder = require('@john-yuan/dev-browserify-builder');

builder.build('src/main.js', 'dist/main.min.js', {
    // The browserify options
    debug: false,
    detectGlobals: false
}, {
    // The uglify-js options
    compress: {
        drop_console: true
    }
}, function (code) {
    // Build finish callback
});

API

/**
 * Bundle the entry javascript file and its dependencies and minify the result.
 *
 * @param {string} entry The entry javascript file path
 * @param {string} output The path to save the result file
 * @param {Object} browserifyOptions The options passed to browserify
 * @param {Object} uglifyOptions The options passed to uglify-js
 * @param {(code: string) => void} callback The build finish callback, `code` is the final result
 */
builder.build(entry, output, browserifyOptions, uglifyOptions, callback);

Keywords

browserify

FAQs

Package last updated on 16 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts