diff --git a/.gitignore b/.gitignore index cc1dea1..9eb28b0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ module/ node_modules/ *.mjs *.js +!src/dzeio/stylusUtils.js *.d.ts !src/stylus.d.ts !.storybook/*.js diff --git a/src/dzeio/stylusUtils.js b/src/dzeio/stylusUtils.js new file mode 100644 index 0000000..fef81ba --- /dev/null +++ b/src/dzeio/stylusUtils.js @@ -0,0 +1,11 @@ + +// See https://github.com/stylus/stylus/issues/1872#issuecomment-86553717 +var stylus = require('stylus'); + +module.exports = function() { + return function(style) { + style.define('file-exists', function(path) { + return !!stylus.utils.lookup(path.string, this.paths); + }); + }; +}; \ No newline at end of file