1.1.1 • Published 11 years ago

bsp-grunt v1.1.1

Weekly downloads
36
License
-
Repository
github
Last release
11 years ago

Introduction

Standard set of Grunt configuration for Brightspot projects using the following:

Usage

NPM

package.json (for Grunt dependencies):

{
  "name": "foo",
  "devDependencies": {
    "bsp-grunt": "1.1.1"
  }
}

Bower

bower.json (for project-specific dependencies):

{
  "name": "foo",
  "dependencies": {
    "jquery": "~1.11.0"
  }
}

Grunt

Gruntfile.js:

module.exports = function(grunt) {
  require('bsp-grunt')(grunt, {
    bsp: {
      styles: {
        dir: "assets/styles",
        less: "foo.less"
      },
      scripts: {
        dir: "assets/scripts",
        rjsModules: [
            {
                name: "foo"
            }
        ]
      }
    }
  });
};

Note that require('bsp-grunt')(grunt, { ... }) replaces grunt.initConfig({ ... }). For example, to use grunt-contrib-uglify and provide its configuration:

module.exports = function(grunt) {
  require('bsp-grunt')(grunt, {
    ...,
    uglify: { ... }
  });

  grunt.loadNpmTasks('grunt-contrib-uglify');

  grunt.registerTask('default', [
    'bsp',
    'uglify'
  ])
};

Autoprefixer

To change the supported list of browsers (see https://github.com/ai/autoprefixer#browsers for the) syntax):

module.exports = function(grunt) {
  require('bsp-grunt')(grunt, {
    ...,
    autoprefixer: {
      process: {
        options: {
          browsers: [ 'last 1 version', '> 1%', 'Explorer 7' ]
        }
      }
    }
  });

HTML

While developing locally, use the following to compile LESS and apply Autoprefixer on the fly:

<script type="text/javascript" src="/assets/scripts/less-dev.js"></script>
<script type="text/javascript" src="/assets/scripts/less.js"></script>
1.1.1

11 years ago

1.1.0

11 years ago

1.0.8

11 years ago

1.0.7

11 years ago

1.0.6

11 years ago

1.0.5

11 years ago

1.0.4

11 years ago

1.0.3

11 years ago

1.0.2

11 years ago

1.0.1

11 years ago

1.0.0

11 years ago