From a9fea342ebef23ccb0b2ab8e4cff73ea1bcb4da7 Mon Sep 17 00:00:00 2001 From: Niklas Ravnsborg-Gjertsen Date: Thu, 20 Nov 2014 15:44:54 +0100 Subject: [PATCH] Setup Grunt to compile and autoprefix the SASS Type `npm install` to install all dependencies. Type `grunt` everytime you want to rebuild the css. --- .gitignore | 4 +++- Gruntfile.js | 25 +++++++++++++++++++++++++ package.json | 7 ++++++- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 Gruntfile.js diff --git a/.gitignore b/.gitignore index 6690cbc..bd83d36 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,6 @@ venv blender-bfct/config.py blender-bfct/runserver.wsgi node_modules -blender-bfct/application/static/assets/css/main.css \ No newline at end of file +blender-bfct/application/static/assets/css/main.css +.sass-cache/ +*css.map \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..e47c480 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,25 @@ +module.exports = function(grunt) { + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + + sass: { + dist: { + options: { + style: 'compressed' + }, + files: { + 'blender-bfct/application/static/assets/css/main.css': 'blender-bfct/application/static/assets/sass/main.sass' + } + } + }, + + autoprefixer: { + no_dest: { src: 'blender-bfct/application/static/assets/css/main.css' } + } + }); + + grunt.loadNpmTasks('grunt-contrib-sass'); + grunt.loadNpmTasks('grunt-autoprefixer'); + + grunt.registerTask('default', ['sass', 'autoprefixer']); +}; diff --git a/package.json b/package.json index bab6689..7a5db32 100644 --- a/package.json +++ b/package.json @@ -5,5 +5,10 @@ "url": "git://git.blender.org/blender-bfct.git" }, "author": "Blender Foundation", - "license": "GPL" + "license": "GPL", + "devDependencies": { + "grunt": "^0.4.5", + "grunt-autoprefixer": "^2.0.0", + "grunt-contrib-sass": "^0.8.1" + } }