1.9.8 • Published 7 years ago

gulp-bundle-files v1.9.8

Weekly downloads
67
License
MIT
Repository
github
Last release
7 years ago

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.

1.9.8

7 years ago

1.9.7

7 years ago

1.9.6

7 years ago

1.9.5113

7 years ago

1.9.5112

7 years ago

1.9.5110

7 years ago

1.9.3778

7 years ago

1.9.3777

7 years ago

1.9.3776

7 years ago

1.9.2664

7 years ago

1.9.1332

7 years ago

1.8.4664

7 years ago

1.8.4663

7 years ago

1.8.4662

7 years ago

1.8.3996

8 years ago

1.8.2664

8 years ago

1.8.666

8 years ago

1.7.2664

8 years ago

1.7.1332

8 years ago

1.7.666

8 years ago

1.6.667

8 years ago

1.6.666

8 years ago

1.6.66

8 years ago

1.333.666

8 years ago

1.18.16661

8 years ago

1.17.1001

8 years ago

1.17.1

8 years ago

1.4.0

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.3

8 years ago

1.2.0

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago