Last active
August 29, 2015 14:05
-
-
Save iambacon/9c24e5b5050ae5573d66 to your computer and use it in GitHub Desktop.
Compiling SASS with libsass, Autoprefixer and grunt
This file contains 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.loadNpmTasks('grunt-sass'); | |
grunt.loadNpmTasks('grunt-autoprefixer'); | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
// Sass | |
sass: { | |
options: { | |
sourceMap: true, // Create source map | |
outputStyle: 'compressed' // minify output | |
}, | |
dist: { | |
files: [ | |
{ | |
expand: true, // Recursive | |
cwd: "sass/brand", // The startup directory | |
src: ["**/*.scss"], // Source files | |
dest: "stylesheets", // Destination | |
ext: ".css" // File extension | |
} | |
] | |
} | |
}, | |
// Autoprefixer | |
autoprefixer: { | |
options: { | |
browsers: [ | |
'Android 4', | |
'last 2 Chrome version', | |
'last 2 iOS version', | |
'last 2 Safari version', | |
'last 2 ChromeAndroid version', | |
'last 2 FirefoxAndroid version', | |
'last 2 ExplorerMobile version' | |
], | |
map: true // Update source map (creates one if it can't find an existing map) | |
}, | |
// Prefix all files | |
multiple_files: { | |
flatten: true, | |
src: 'stylesheets/**/*.css' | |
}, | |
} | |
}); | |
grunt.registerTask('default', ['sass', 'autoprefixer']); | |
}; |
This file contains 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": "MoSite", | |
"version": "0.0.1", | |
"devDependencies": { | |
"grunt": "0.4.5", | |
"grunt-sass": "^0.12.1", | |
"grunt-autoprefixer": "1.0.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment