stylus-import-if-exist

1.1.0 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i stylus-import-if-exist

Weekly Downloads

53

Version

1.1.0

License

MIT

Last publish

Collaborators

  • dzhiriki