Created
January 2, 2014 17:26
-
-
Save clupprich/8222739 to your computer and use it in GitHub Desktop.
Gruntfile for developing Ghost themes. Heavily inspired by http://webdesign.tutsplus.com/tutorials/cms-tutorials/styling-our-ghost-theme-with-less/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
watch: { | |
css: { | |
files: ['styles/*'], | |
tasks: ['sass', 'cssmin', 'copy:css'] | |
}, | |
js: { | |
files: ['js/*'], | |
tasks: ['uglify', 'copy:js'] | |
} | |
}, | |
uglify: { | |
options: { | |
mangle: false | |
}, | |
combinejs: { | |
files: { | |
'dist/js/main.min.js': ['js/main.js'] | |
} | |
} | |
}, | |
sass: { | |
dist: { | |
files: { | |
'dist/css/main.css': ['styles/main.scss'] | |
} | |
} | |
}, | |
cssmin: { | |
combine: { | |
files: { | |
'dist/css/main.min.css': ['dist/css/main.css'] | |
} | |
} | |
}, | |
copy: { | |
js: { | |
src: 'dist/js/main.min.js', | |
dest: '<%= ghost_location %>content/themes/<%= ghost_theme_name %>/assets/js/main.min.js' | |
}, | |
css: { | |
src: 'dist/css/main.min.css', | |
dest: '<%= ghost_location %>content/themes/<%= ghost_theme_name %>/assets/css/main.css' | |
} | |
}, | |
'ghost_location': '../ghost/', | |
'ghost_theme_name': 'naiad', | |
}); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-cssmin'); | |
grunt.loadNpmTasks('grunt-contrib-sass'); | |
grunt.loadNpmTasks('grunt-contrib-copy'); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment