Skip to content

Instantly share code, notes, and snippets.

@hpoom
Created November 13, 2014 17:10
Show Gist options
  • Save hpoom/75f070c19f7e3275e13c to your computer and use it in GitHub Desktop.
Save hpoom/75f070c19f7e3275e13c to your computer and use it in GitHub Desktop.
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