Skip to content

Instantly share code, notes, and snippets.

@ricardoriogo
Last active December 6, 2015 15:32
Show Gist options
  • Save ricardoriogo/7e95f1b1ea411a9d323e to your computer and use it in GitHub Desktop.
Save ricardoriogo/7e95f1b1ea411a9d323e to your computer and use it in GitHub Desktop.
Little file to create a autoimport SASS files.
var glob = require("glob"),
fs = require('fs'),
contents = '',
prefix = 'app/',
importFile = '_app-import.scss';
glob(prefix + "*/**/*.scss", function (er, files) {
for(file in files){
contents += "@import '" + files[file].replace(prefix, '') +"'; \n";
}
fs.writeFile(prefix + importFile, contents, function(err) {
if(err) {
return console.log(err);
}
console.log("The file was saved!");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment