Giter Club home page Giter Club logo

grunt-bower-concat's Introduction

Bower components builder for Grunt

Build Status Built with Grunt

Automatic concatenation of installed Bower components in right order.

Installation

This plugin requires Grunt 0.4.

$ npm install grunt-bower-concat --save-dev

Configuration

Add somewhere in your Gruntfile.js:

grunt.loadNpmTasks('grunt-bower-concat');

Inside your Gruntfile.js file add a section named bower_concat. See Parameters section below for details.

Parameters

dest

Type: String.

Name of file where result of concatenation will be saved.

exclude

Type: String|Array, optional.

List of components you want to exclude.

exclude: [
	'jquery',
	'modernizr'
]

include

Type: String|Array, optional.

By default bower-concat will include all installed in project components. Using include option you can manually specify which components should be included.

include: [
	'underscore',
	'backbone'
]

dependencies

Type: Object, optional.

Unfortunately not all Bower components list their dependencies. If comoponents concatenates in wrong order use this option to manually specify dependencies for that components.

dependencies: {
  'underscore': 'jquery',
  'mygallery': ['jquery', 'fotorama']
}

mainFiles

Type: Object, optional.

Some Bower components don’t list their main files or (more likely) don’t have bower.json file at all. In this case bower-concat will try to guess main file but sometimes it can’t or choose wrong one. You could explicitly define main files for that components.

mainFiles: {
  'svg.js': 'dist/svg.js',
  'mygallery': ['src/base.js', 'src/gallery.js']
}

bowerOptions

Type: Object, optional.

Bower specific options that will be passed in during the bower.commands calls.

bowerOptions: {
  relative: false
}

Config Example

bower_concat: {
  all: {
    dest: 'build/_bower.js',
    exclude: [
    	'jquery',
    	'modernizr'
    ],
    dependencies: {
      'underscore': 'jquery',
      'backbone': 'underscore',
      'jquery-mousewheel': 'jquery'
    },
    bowerOptions: {
      relative: false
    }
  }
}

Changelog

The changelog can be found in the Changelog.md file.


License

The MIT License, see the included License.md file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.