Skip to content

Grunt task for freezing versions of bower dependencies.

License

Notifications You must be signed in to change notification settings

comerge/grunt-bower-freeze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-bower-freeze

Lock the bower.json to exact versions

Build Status

Getting Started

This plugin requires Grunt ~0.4.5

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-bower-freeze --save-dev

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

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

The "bowerfreeze" task

Overview

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

grunt.initConfig({
    bowerfreeze: {
        freeze: {
            src: 'bower.json',
            dest: 'bower-frozen.json'
        }
    }
});

Options

options.cwd

Type: String Default value: './'

If set all src and dest paths will be set relative to cwd.

options.install

Type: boolean Default value: false

Install bower before freezing (only if options.update = false).

options.update

Type: boolean Default value: false

Update bower before freezing. Overrides options.install.

Usage Examples

Default Options

In this example, the default options are used to freeze the versions of the bower.json in the current working directory.

grunt.initConfig({
    bowerfreeze: {
        freeze: {
            src: 'bower.json',
            dest: 'bower-frozen.json'
        }
    }
});

Custom Options

In this example, the default options are used to freeze the versions of the bower.json in the specified cwd. Additionally, all bower dependencies are updated before freezing.

grunt.initConfig({
    bowerfreeze: {
        freeze: {
            options: {
                cwd: 'tmp/default/',
                update: true
            },
            src: 'bower.json',
            dest: 'bower-frozen.json'
        },
    }
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

See the CHANGELOG.

About

Grunt task for freezing versions of bower dependencies.

Resources

License

Stars

Watchers

Forks

Packages

No packages published