Skip to content

Instantly share code, notes, and snippets.

@stowball
Created December 16, 2015 01:26
Show Gist options
  • Select an option

  • Save stowball/47c72aca31b835398dd4 to your computer and use it in GitHub Desktop.

Select an option

Save stowball/47c72aca31b835398dd4 to your computer and use it in GitHub Desktop.
grunt-sass simplified node_modules imports
var path = require('path');
function importPaths(url, file, done) {
try {
var newPath = path.relative(path.dirname(file), require.resolve(url + '.scss'));
return done({ file: newPath })
} catch (e) {
return done({ file: url})
}
}
module.exports = {
tvGuide: {
'options': {
'outputStyle' : 'compressed',
'sourceMap' : true,
'importer' : importPaths
},
'files': [{
'expand' : true,
'cwd' : 'src/scss',
'src' : '**/*.scss',
'dest' : 'dist/css',
'ext' : '.min.css'
}]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment