Skip to content

Instantly share code, notes, and snippets.

@uixmat
Created May 15, 2017 21:24
Show Gist options
  • Save uixmat/bc494335dd7be068e79efc4a8da7c06f to your computer and use it in GitHub Desktop.
Save uixmat/bc494335dd7be068e79efc4a8da7c06f to your computer and use it in GitHub Desktop.
Gruntfile.js Sass + Autoprefixer + Live Reload + Server
module.exports = function(grunt) {
// Configuration.
grunt.initConfig({
sass: {
dist: {
options: {
sourcemap: 'none',
style: 'compressed'
},
files: {
'css/styles.css': 'scss/theme.scss'
}
}
},
autoprefixer:{
dist:{
files:{
'css/styles.css':'css/styles.css'
}
}
},
connect: {
server: {
options: {
port: 8000
}
}
},
watch: {
options: {
livereload: true,
},
css: {
files: 'scss/*.scss',
tasks: ['sass', 'autoprefixer'],
}
}
});
// Load Tasks
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-connect');
// Default task(s).
grunt.registerTask('default', ['connect', 'watch']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment