Created
April 3, 2014 16:01
-
-
Save apfelbox/9957261 to your computer and use it in GitHub Desktop.
PoC for grunt sass for symfony config
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) { | |
var path = require("path"); | |
grunt.loadNpmTasks("grunt-contrib-sass"); | |
grunt.initConfig({ | |
sass: { | |
bundles: { | |
options: { | |
quiet: true | |
}, | |
files: [{ | |
expand: true, | |
cwd: "src", | |
src: ["*/*/Resources/assets/scss/*.scss"], | |
dest: "public/css", | |
ext: ".css", | |
rename: function (dest, matchedSrcPath, options) | |
{ | |
var fileName = path.basename(matchedSrcPath); | |
var filePath = matchedSrcPath.replace(/Resources\/.*$/, "Resources/") + dest.replace(/\/*$/, "") + "/"; | |
return filePath + fileName; | |
} | |
}] | |
} | |
} | |
}); | |
grunt.registerTask("default", ["sass"]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment