nunta/Gruntfile.js
David Miller 2f3ed586a7 Remove Bower package - simplify Grunt task
Removing Bower package in favor of creating a Yeoman scaffold because a
template is more of a scaffold than a component
2014-09-11 02:15:19 -04:00

109 lines
3.2 KiB
JavaScript

module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copy: {
main: {
src: ['*.html', 'mail/**', 'js/**', 'img/**'],
dest: 'dist/',
},
jquery: {
files: [
{
expand: true,
cwd: 'bower_components/jquery/dist/',
src: [
'jquery.min.js',
'jquery.js',
],
dest: 'dist/js/'
},
]
},
bootstrap: {
files: [
{
expand: true,
cwd: 'bower_components/bootstrap/dist/',
src: [
'js/bootstrap.js',
'js/bootstrap.min.js',
'css/bootstrap.css',
'css/bootstrap.min.css'
],
dest: 'dist/'
},
]
},
glyphicons: {
files: [
{
expand: true,
cwd: 'bower_components/bootstrap/',
src: [
'fonts/glyphicons-halflings-regular.eot',
'fonts/glyphicons-halflings-regular.svg',
'fonts/glyphicons-halflings-regular.ttf',
'fonts/glyphicons-halflings-regular.woff',
],
dest: 'dist/'
},
]
},
},
less: {
development: {
options: {
paths: ["css"]
},
files: {
"dist/css/<%= pkg.name %>.css": "less/<%= pkg.name %>.less"
}
},
production: {
options: {
paths: ["css"],
cleancss: true
},
files: {
"dist/css/<%= pkg.name %>.css": "less/<%= pkg.name %>.less"
}
}
},
watch: {
scripts: {
files: ['js/**'],
tasks: ['concat'],
options: {
spawn: false,
},
},
css: {
files: ['less/*.less'],
tasks: ['less'],
options: {
spawn: false,
}
},
html: {
files: ['*.html', 'mail/**'],
tasks: ['copy'],
options: {
spawn: false,
}
},
}
});
// Load the plugins.
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task(s).
grunt.registerTask('default', ['copy', 'less']);
grunt.registerTask('less-compile', ['less']);
};