Created
February 23, 2016 02:14
-
-
Save tlinkner/a350676dbdab44e813b4 to your computer and use it in GitHub Desktop.
Drupal 8 Grunt Livereload
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) { | |
"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']); | |
}; |
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
{ | |
"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