mirror of
https://github.com/kremalicious/blog.git
synced 2024-12-23 01:30:01 +01:00
assets versioning during grunt build, closes #10
This commit is contained in:
parent
67efcc04e6
commit
ccbd65fda5
33
Gruntfile.js
33
Gruntfile.js
@ -9,7 +9,8 @@ module.exports = function(grunt){
|
||||
less: 'assets/less',
|
||||
css: 'assets/css',
|
||||
js: 'assets/js',
|
||||
img: 'assets/img'
|
||||
img: 'assets/img',
|
||||
fonts: 'assets/fonts'
|
||||
}
|
||||
};
|
||||
|
||||
@ -179,6 +180,25 @@ module.exports = function(grunt){
|
||||
},
|
||||
},
|
||||
|
||||
// assets versioning
|
||||
rev: {
|
||||
files: {
|
||||
src: [
|
||||
'<%= config.site %>/assets/{css,js,img,fonts}/*.*'
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
// updating assets paths in html/css
|
||||
usemin: {
|
||||
html: ['<%= config.site %>/**/*.html'],
|
||||
css: ['<%= config.site %>/**/*.css'],
|
||||
options: {
|
||||
dirs: ['<%= config.site %>'],
|
||||
basedir: ['<%= config.site %>']
|
||||
}
|
||||
},
|
||||
|
||||
// rsync stuff around
|
||||
rsync: {
|
||||
options: {
|
||||
@ -227,8 +247,8 @@ module.exports = function(grunt){
|
||||
|
||||
// Full Dev server
|
||||
grunt.registerTask('server', [
|
||||
'rsync:copy_media',
|
||||
'jekyll:development',
|
||||
'rsync:copy_media',
|
||||
'less',
|
||||
'cmq',
|
||||
'cssmin',
|
||||
@ -250,14 +270,15 @@ module.exports = function(grunt){
|
||||
// Production build
|
||||
grunt.registerTask('build', [
|
||||
'clean',
|
||||
'rsync:copy_media',
|
||||
'jekyll:production',
|
||||
'imagemin:assets',
|
||||
'imagemin:touchicons',
|
||||
'rsync:copy_media',
|
||||
'less',
|
||||
'cmq',
|
||||
'cssmin',
|
||||
'uglify'
|
||||
'uglify',
|
||||
'rev',
|
||||
'usemin',
|
||||
'imagemin'
|
||||
]);
|
||||
|
||||
// Deploy
|
||||
|
@ -10,13 +10,15 @@
|
||||
"grunt-contrib-clean": "~0.5.0",
|
||||
"grunt-contrib-connect": "~0.5.0",
|
||||
"grunt-contrib-cssmin": "~0.6.2",
|
||||
"grunt-contrib-less": "~0.6.4",
|
||||
"grunt-contrib-less": "~0.6.4",
|
||||
"grunt-contrib-imagemin": "~0.4.0",
|
||||
"grunt-contrib-uglify": "~0.2.2",
|
||||
"grunt-contrib-watch": "~0.5.3",
|
||||
"grunt-combine-media-queries": "~1.0.8",
|
||||
"grunt-jekyll": "~0.4.0",
|
||||
"grunt-rsync": "~0.2.1"
|
||||
"grunt-rsync": "~0.2.1",
|
||||
"grunt-rev": "~0.1.0",
|
||||
"grunt-usemin": "~2.0.2"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
Loading…
Reference in New Issue
Block a user