npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-bundle-files

v1.9.8

Published

Gulp module to concatenate and postprocess configured bundles

Downloads

92

Readme

Gulp Bundle Files

Build Status Coverage Status npm version Downloads Deps bitHound Code Windows Build status Code Climate Coverity Scan Build Status Average time to resolve an issue Percentage of issues still open License: MIT

A wrapper for gulp-concat that performs additional runtime configuration checks along with creating a separate task/stream for all the pieces you're attempting to build. Utilizing a JSON based configuration, the module will combine/concat and uglify bundles of javascript. In addition to processing javascript gulp-bundle-files will also combine/concat, autoprefix, and minify css.

How it works

By defining your "bundles" in a properly formatted JSON configuration file and passing your config to gulp-bundle-files you'll be dynamically creating a task for every bundle. Each of these tasks is appended into gulp's run sequence. Basically the task you define for gulp-bundle-files adds a gulp.task for every bundle defined in your application's configuration, then all the dynamic tasks get run once the plugin finishes. Each of these tasks will be added into gulps sequence in the order your 'default' task defines, using the plugin will just insert these tasks wherever it gets called in your build order.

Usage

var gulp = require('gulp'),
    gulpBundleFiles = require('gulp-bundle-files'),
    bundles = require('./sample-options.json');

gulp.task('bundle', function() {
    gulpBundleFiles(bundles);
});

gulp.task('default', ['bundle']);

Configuration Syntax

The plugin assumes your task for bundling is named "bundle" if you have a different name, just specify it in the config. This prevents the dynamic tasks from being called in the wrong contexts when using gulp watch.

{
  "parentTaskName": "bundle",
  "concat": {
    "active": true,
    "config": {}
  },
  "uglify": {
    "active": false,
    "config": {}
  },
  "sourcemap": {
    "active": true,
    "config": {}
  },
  "destinationFolder": "dist",
  "newLine": ";",
  "files": {
    "js/test.js": [
      "tests/fixtures.js",
      "tests/main.js"
    ],
    "js/test2.js": [
      "tests/fixtures.js",
      "tests/main.js"
    ],
    "css/test.css": [
      "tests/css/test.css",
      "tests/css/test2.css"
    ]
  }
}

Options

Concat

Used to specify whether or not concat is active along with the configuration for concat, the config's format should match the options outlined here: https://github.com/contra/gulp-concat

Uglify

Used to specify whether or not uglify is active along with the configuration for uglify, the config's format should match the options outlined here: https://github.com/terinjokes/gulp-uglify

Sourcemap

User to specify whether or not sourcemaps is active along with the configuration for sourcemaps, the config's format should match the options outlined here: https://github.com/floridoo/gulp-sourcemaps

Destination Folder

This option specifies the location where your completed bundles are going to be written to, it's relative to the current working directory, in most cases this would be your project's directory

Files

This option is used to configure what bundles you're going to be creating with Gulp. These end up being key/value paired object literals whose value is an array of files the bundle will contain. In this case the key will be the file containing all of the value's parts, or the built file.

Contributing to this project

Anyone and everyone is welcome to contribute. Please take a moment to review the guidelines for contributing.