Skip to content

Instantly share code, notes, and snippets.

@micahgodbolt
Last active December 3, 2018 12:39
Show Gist options
  • Save micahgodbolt/6402142 to your computer and use it in GitHub Desktop.
Save micahgodbolt/6402142 to your computer and use it in GitHub Desktop.
Quick grunt setup with compass compile and live reload
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compass: { // Task
dist: { // Target
options: { // Target options
environment: 'production',
config: 'config.rb'
}
}
},
watch: {
options: { livereload: true },
sass: {
files: ['sass/**/*.scss'],
tasks: ['compass'],
},
html: {
files: ['**/*.html'],
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.registerTask('default', ['compass', 'watch']);
};
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="css/screen.css">
<script src="http://localhost:35729/livereload.js"></script>
</head>
<body>
</body>
</html>
{
"name": "angular",
"version": "0.0.0",
"description": "test project",
"main": "index.js",
"dependencies": {
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
"grunt-contrib-watch": "~0.5.3"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "BSD-2-Clause",
"devDependencies": {
"grunt-contrib-sass": "~0.5.0",
"grunt-contrib-compass": "~0.5.0",
"grunt-contrib-watch": "~0.5.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment