Skip to content

Instantly share code, notes, and snippets.

@frankbaele
Last active December 31, 2015 12:19
Show Gist options
  • Save frankbaele/7985156 to your computer and use it in GitHub Desktop.
Save frankbaele/7985156 to your computer and use it in GitHub Desktop.
libsass grunt + bourbon
module.exports = function (grunt) {
"use strict";
var neat = require('node-neat').includePaths;
// Config...
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {
port: 9001,
// Prevents Grunt to close just after the task (starting the server) completes
// This will be removed later as `watch` will take care of that
keepalive: false,
hostname: '',
}
}
},
watch: {
options: {
livereload: true,
},
scripts: {
files: ['./js/src/**/*.js'],
tasks: ['jshint','concat']
},
html: {
files: ['./index.html']
},
pictures: {
files: ['./img/**/*']
},
css: {
files: ['./sass/**/*.scss'],
tasks: ['sass']
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'js/src/**/*.js',
'!js/scripts.gen.js'
]
},
uglify: {
prod: {
options: {
mangle: true,
compress: true
},
files: {
'js/scripts.gen.js': ['js/scripts.gen.js']
}
}
},
concat: {
dist: {
src: ['js/src/**/*.js'],
dest: 'js/scripts.gen.js'
}
},
favicons: {
options: {
trueColor: true,
precomposed: false,
appleTouchBackgroundColor: "#f5f5dc",
coast: true,
windowsTile: true,
tileBlackWhite: false,
tileColor: "auto",
html: 'index.html',
HTMLPrefix: "/sites/all/themes/xtheme/img/icons/"
},
icons: {
src: 'icon.png',
dest: 'img/icons'
}
},
copy:{
favicon: {
src: 'img/icons/favicon.ico',
dest: 'favicon.ico'
}
},
sass: {
options: {
includePaths: neat,
outputStyle: 'compressed'
},
dist: {
files: {
'./css/style.css': './sass/style.scss',
'./css/ie.css': './sass/ie.scss',
'./css/print.css': './sass/print.scss',
'./css/wysiwyg.css': './sass/wysiwyg.scss'
}
}
}
});
// Load tasks...
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-favicons');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-sass');
// Task aliases and tasks
grunt.registerTask('server', [
'connect',
'watch'
]);
grunt.registerTask('prod', [
'concat',
'uglify:prod'
]);
grunt.registerTask('icons', [
'favicons',
'copy:favicon'
]);
// Default task.
grunt.registerTask('default', 'server');
};
{
"name": "xtheme",
"version": "0.0.1",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-open": "~0.2.0",
"grunt-contrib-connect": "~0.3.0",
"path": "~0.4.9",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-jshint": "~0.7.2",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-uglify": "~0.2.7",
"grunt-favicons": "~0.4.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-sass": "~0.9.0",
"node-bourbon": "~1.0.0",
"node-sass": "~0.7.0",
"node-neat": "~1.1.0"
}
}
@charset "UTF-8";
/**
* Style file
*
* This file is compiled into style.css
*/
@import "bourbon";
@import "neat";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment