Created
May 15, 2017 21:24
-
-
Save uixmat/bc494335dd7be068e79efc4a8da7c06f to your computer and use it in GitHub Desktop.
Gruntfile.js Sass + Autoprefixer + Live Reload + Server
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) { | |
// 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