grunt-profile

1.0.3 • Public • Published

Grunt: Profiles

Environment profiles configuration for grunt, many thanks for the idea to Logan Koester

Gittip

NPM

Getting Started

This plugin requires Grunt ~0.4.1

To install:

npm install grunt-profile --save-dev

How to use:

grunt.initConfig({
  // ...
 
  profile: {
    default: 'local',
    profiles: ['local', 'live']
  },
 
  concat: {
    options: {
      separator: ';',
      sourceMap: false,
      local: {
        sourceMap: true  
      }
    },
    // ...
 
  }
});
 
grunt.loadNpmTasks('grunt-profile');
 

You can use profile/profiles at any place in any task configuration, based on the current profile it would be automatically substituted with the correct one. For example running the snippet about with:

grunt concat

Will include the sourceMap, and with:

grunt profile:live concat

will not.

You can setup as many profiles as you like, these two is just for the reference.

Package Sidebar

Install

npm i grunt-profile

Weekly Downloads

10

Version

1.0.3

License

none

Last publish

Collaborators

  • imapi