resume/Gruntfile.js

102 lines
3.4 KiB
JavaScript
Raw Normal View History

2016-07-03 20:54:55 -07:00
module.exports = function (grunt) {
grunt.initConfig({
2016-07-11 14:56:40 -07:00
pkg: grunt.file.readJSON('package.json'),
2016-07-03 20:54:55 -07:00
bower: {
2016-07-03 22:17:58 -07:00
js: {
2016-07-03 20:54:55 -07:00
dest: 'web/js/vendor',
options: {
2016-07-11 14:56:40 -07:00
cleanTargetDir: true,
checkExistence: true,
debugging: false,
2016-07-03 20:54:55 -07:00
paths: {
bowerDirectory: 'vendor/bower',
bowerrc: '.bowerrc',
bowerJson: 'bower.json'
}
}
}
},
2016-07-03 22:17:58 -07:00
copy: {
dist: {
files: [
{
expand: true,
cwd: 'vendor/bower/uikit/fonts',
src: ['*'],
dest: 'web/fonts',
filter: 'isFile'
}
]
}
},
2016-07-03 20:54:55 -07:00
less: {
build: {
options: {
plugins: [new (require('less-plugin-autoprefix'))({browsers: ["last 3 versions"]}),],
paths: [
'vendor/bower/uikit/less',
'src/Sikofitt/less'
],
strictImports: true,
compress: true
},
files: {
'web/css/resume.min.css': 'src/Sikofitt/less/resume.less'
}
}
},
watch: {
2016-07-11 14:56:40 -07:00
configFiles: {
files: ['Gruntfile.js'],
options: {
reload: true
}
},
dev: {
files: ['src/Sikofitt/less/*', 'src/Sikofitt/js/*'],
2016-07-12 11:11:11 -07:00
tasks: ['dev'],
options: {
atBegin: true
}
},
options: {
dateFormat: function(time) {
d = new Date();
grunt.log.ok('Grunt tasks finished in ' + time + 'ms on ' + d.toDateString() + ' at ' + d.toTimeString());
grunt.log.ok('Watching ...');
}
2016-07-11 14:56:40 -07:00
}
},
uglify: {
options: {
mangle: true,
2016-07-12 11:11:11 -07:00
report: 'gzip',
2016-07-11 14:56:40 -07:00
compress: {
drop_console: true
},
2016-07-12 11:11:11 -07:00
banner: '/*! \n * Resume.PHP - v<%= pkg.version %> @license MIT (http://resume.reric.me)\n' +
' * <%= grunt.template.today("dddd, mmmm dS, yyyy, h:MM:ss tt") %> \n */\n',
footer: '\n/*! Resume.PHP end */',
nameCache: '.tmp/grunt-uglify-cache.json',
preserveComments: 'some',
2016-07-11 14:56:40 -07:00
},
dist: {
files: {'web/js/resume.min.js': ['src/Sikofitt/js/resume.js']}
}
2016-07-03 20:54:55 -07:00
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('main-bower-files');
grunt.loadNpmTasks('grunt-phpunit');
2016-07-03 22:17:58 -07:00
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
2016-07-11 14:56:40 -07:00
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('dist', ['bower', 'less', 'uglify', 'copy']);
grunt.registerTask('dev', ['less', 'uglify'])
2016-07-03 20:54:55 -07:00
grunt.registerTask('default', 'dist');
};