From b586a32d002c40b24ba6e1585333ffc795be20be Mon Sep 17 00:00:00 2001 From: Avior Date: Mon, 29 Mar 2021 14:05:03 +0200 Subject: [PATCH] Added back stylus utils Signed-off-by: Avior --- .gitignore | 1 + src/dzeio/stylusUtils.js | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 src/dzeio/stylusUtils.js 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