Added back stylus utils

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2021-03-29 14:05:03 +02:00
parent ba3dcb22a1
commit b586a32d00
Signed by: Florian Bouillon
GPG Key ID: 50BD648F12C86AB6
2 changed files with 12 additions and 0 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@ module/
node_modules/
*.mjs
*.js
!src/dzeio/stylusUtils.js
*.d.ts
!src/stylus.d.ts
!.storybook/*.js

11
src/dzeio/stylusUtils.js Normal file
View File

@ -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);
});
};
};