grunt-bit-bundler

3.0.1 • Public • Published

grunt-bit-bundler

bit-bundler grunt plugin

Getting Started

This plugin requires Grunt ~1.0.1

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-bit-bundler --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-bit-bundler');

The "bitbundler" task

Overview

In your project's Gruntfile, add a section named bitbundler to the data object passed into grunt.initConfig().

grunt.initConfig({
  bitbundler: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
});

Examples

Go here for a full running setup.

Base configuration

In this example, bitbundler will load src/testing and src/123 as entry modules, and the bundle is written to dest/app.js. Using the bundler splitter, this configuration will automatically split out all vendor modules into its own bundle.

var jsPlugin = require('bit-loader-js');
var splitBundle = require('bit-bundler-splitter');

grunt.initConfig({
  bitbundler: {
    build: {
      watch: true,
      files: [{
        dest:'dest/app.js',
        src: ['src/testing', 'src/123']
      }],
      loader: {
        plugins: [
          jsPlugin()
        ]
      },
      bundler: {
        plugins: [
          splitBundle('dest/vendor.js')
        ]
      }
    }
  }
});

License

Licensed under MIT

Readme

Keywords

Package Sidebar

Install

npm i grunt-bit-bundler

Weekly Downloads

1

Version

3.0.1

License

MIT

Last publish

Collaborators

  • manchagnu