Last active
October 12, 2015 18:15
-
-
Save bcomnes/9c84b4b1edb75c698c56 to your computer and use it in GitHub Desktop.
Require the style folder exposed by package.json
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 path = require('path') | |
function requireCss (module) { | |
var packagejson = module + '/package.json' | |
var pathName = path.dirname(require.resolve(packagejson)) | |
var stylePath = require(packagejson).style | |
var style = path.join(pathName, stylePath) | |
return { | |
style: style, | |
path: path.dirname(style) | |
} | |
} | |
module.exports = requireCss |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment