Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

Latest commit

 

History

History
30 lines (21 loc) · 1.21 KB

readme.md

File metadata and controls

30 lines (21 loc) · 1.21 KB

Stylus Import If Exist

Build Status Coverage Status Dependency Status

Stylus fail build when you try import file which not exist. In some cases it's bad behavior. This plugin solve this problem.

Installation

You can install through npm as such: npm install stylus-import-if-exist

Usage

You can include stylus-import-if-exist as a normal stylus plugin. Example:

var stylus = require('stylus');
var importIfExist = require('stylus-import-if-exist');

stylus(css)
  .use(importIfExist())
  .render(function(err, output){
    console.log(output);
  });

You should replace all your @import with import(). For example, instead use @import 'example' you should use import(example). If file exist, it will be imported; if not  – nothing will happen.