-
-
Save lennym/2c323459f443622b9f71 to your computer and use it in GitHub Desktop.
node-sass build script
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
#!/usr/bin/env node | |
var sass = require('node-sass'), | |
path = require('path'), | |
fs = require('fs'); | |
var src = path.resolve(__dirname, '../assets/sass/app.scss'), | |
out = path.resolve(__dirname, '../public/stylesheets/app.css'); | |
sass.render({ | |
file: src, | |
includePaths: module.paths, | |
success: function (result) { | |
fs.writeFile(out, result.css, function (err) { | |
if (err) { throw err; } | |
else { | |
console.log(src, '>', out); | |
} | |
}) | |
}, | |
error: function (err) { | |
console.log(err); | |
throw new Error(err.message, err.file, err.line); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment