1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-25 11:18:35 +01:00

isolate media minification

This commit is contained in:
Matthias Kretschmann 2013-12-11 23:47:20 +01:00
parent f50a0ae69f
commit eda579fbe1
2 changed files with 27 additions and 15 deletions

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
node_modules node_modules
bower_components bower_components
_site _site
_build

View File

@ -5,6 +5,7 @@ module.exports = function(grunt){
var gruntConfig = { var gruntConfig = {
src: '_src', src: '_src',
site: '_site', site: '_site',
build: '_build',
assets: { assets: {
less: 'assets/less', less: 'assets/less',
css: 'assets/css', css: 'assets/css',
@ -30,10 +31,14 @@ module.exports = function(grunt){
// clean everything // clean everything
clean: { clean: {
build: [ site: [
'<%= config.site %>/*', '<%= config.site %>/*',
'<%= config.site %>/.htaccess', '<%= config.site %>/.htaccess',
'!<%= config.site %>/media' '!<%= config.site %>/media'
],
build: [
'<%= config.build %>/*',
'<%= config.build %>/.htaccess'
] ]
}, },
@ -213,11 +218,19 @@ module.exports = function(grunt){
syncDestIgnoreExcl: true syncDestIgnoreExcl: true
} }
}, },
// copy build
copy_build: {
options: {
src: '<%= config.site %>/',
dest: '<%= config.build %>',
syncDest: true
}
},
// deployment // deployment
deploy: { deploy: {
options: { options: {
syncDest: true, syncDest: true,
src: '<%= config.site %>/', src: '<%= config.build %>/',
dest: 'domains/kremalicious.com/html', dest: 'domains/kremalicious.com/html',
host: 'kremalicious', host: 'kremalicious',
ssh: true, ssh: true,
@ -235,7 +248,7 @@ module.exports = function(grunt){
grunt.loadNpmTasks(file); grunt.loadNpmTasks(file);
}); });
// Default Task // Default Task, assets only
grunt.registerTask('default', [ grunt.registerTask('default', [
'less', 'less',
'cmq', 'cmq',
@ -247,6 +260,7 @@ module.exports = function(grunt){
// Full Dev server // Full Dev server
grunt.registerTask('server', [ grunt.registerTask('server', [
'clean:site',
'jekyll:development', 'jekyll:development',
'rsync:copy_media', 'rsync:copy_media',
'less', 'less',
@ -257,16 +271,6 @@ module.exports = function(grunt){
'watch' 'watch'
]); ]);
// Assets only Dev server
grunt.registerTask('server-assets', [
'less',
'cmq',
'cssmin',
'uglify',
'connect',
'watch'
]);
// Production build // Production build
grunt.registerTask('build', [ grunt.registerTask('build', [
'clean', 'clean',
@ -278,7 +282,14 @@ module.exports = function(grunt){
'uglify', 'uglify',
'rev', 'rev',
'usemin', 'usemin',
'imagemin' 'imagemin:assets',
'imagemin:touchicons',
'rsync:copy_build'
]);
// Optimze media
grunt.registerTask('mediamin', [
'imagemin:media'
]); ]);
// Deploy // Deploy