Lock the bower.json to exact versions
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');
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'
}
}
});
Type: String
Default value: './'
If set all src
and dest
paths will be set relative to cwd
.
Type: boolean
Default value: false
Install bower before freezing (only if options.update = false
).
Type: boolean
Default value: false
Update bower before freezing. Overrides options.install
.
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'
}
}
});
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'
},
}
});
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.
See the CHANGELOG.