Created
November 13, 2014 17:10
-
-
Save hpoom/75f070c19f7e3275e13c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
uglify: { | |
options: { | |
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' | |
}, | |
build: { | |
src: 'src/<%= pkg.name %>.js', | |
dest: 'build/<%= pkg.name %>.min.js' | |
} | |
}, | |
less: { | |
options: { | |
paths: ['css'] | |
}, | |
// target name | |
src: { | |
// no need for files, the config below should work | |
expand: true, | |
cwd: 'less', | |
src: '*.less', | |
dest: 'build', | |
ext: '.css' | |
} | |
}, | |
lint_pattern: { | |
options: { | |
rules: [ | |
{ | |
pattern: /rudeWord/, | |
message: 'Profanity is not allowed.' | |
}, | |
], | |
}, | |
files: [ | |
'src/**.js', | |
'less/**.less' | |
] | |
} | |
}); | |
// Load the plugins that we need. | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-less'); | |
grunt.loadNpmTasks('grunt-lint-pattern'); | |
// Default task(s). | |
grunt.registerTask('default', ['lint_pattern', 'uglify','less']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment