Skip to content

Instantly share code, notes, and snippets.

@tlinkner
Created February 23, 2016 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tlinkner/a350676dbdab44e813b4 to your computer and use it in GitHub Desktop.
Save tlinkner/a350676dbdab44e813b4 to your computer and use it in GitHub Desktop.
Drupal 8 Grunt Livereload
module.exports = function (grunt) {
"use strict";
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
prod: {
options: {
outputStyle: 'compressed'
},
files: {
'themes/custom/watchlearn/css/style.css': 'themes/custom/watchlearn/sass/style.scss',
}
},
dev: {
options: {
outputStyle: 'expanded'
},
files: {
'themes/custom/watchlearn/css/style.css': 'themes/custom/watchlearn/sass/style.scss',
}
}
},
watch: {
options: {
livereload: true,
},
css: {
files: ['themes/custom/watchlearn/sass/**/*.scss',
'themes/custom/watchlearn/**/*.twig',
'themes/custom/watchlearn/**/*.js'],
tasks: ['sass:dev'],
options: {
spawn: false
}
},
livereload: {
options: {
livereload:true
},
files:[
'themes/custom/watchlearn/css/*.css',
]
}
}
});
// Load tasks...
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task.
grunt.registerTask('default', ['watch']);
};
{
"name": "my-project",
"version": "0.1.0",
"devDependencies": {
"grunt": "^0.4.1",
"grunt-contrib-watch": "^0.6.1",
"grunt-sass": "^1.1.0",
"node-sass": "^2.1.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment