Last active
December 6, 2015 15:32
-
-
Save ricardoriogo/7e95f1b1ea411a9d323e to your computer and use it in GitHub Desktop.
Little file to create a autoimport SASS files.
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
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