/scss-inline-imports

A library to inline SCSS @import statements

Primary LanguageJavaScriptBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

SCSS Inline Imports Greenkeeper badge Build Status NPM version

Getting Started

const inlineImports = require('scss-inline-imports')

let { scss } = inlineImports('./index.scss')

// Options
inlineImports('./index.scss', {
  // An array of paths that should be searched when locating an import
  includePaths: [],
  // Include comments above each inlined import
  comments: false
})

// Extras
let { imports, importsFlattened } = inlineImports('./index.scss')

// imports
[
  {
    'path/to/entry': [
      {
        'path/to/first/import': [
          {
            'path/to/first/child/import': []
          }
        ]
      },
      {
        'path/to/second/import': [
          {
            'path/to/second/child/import': []
          }
        ]
      }
    ]
  }
]

// importsFlattened
[
  'path/to/first/child/import',
  'path/to/child/import',
  'path/to/second/child/import',
  'path/to/second/import',
  'path/to/entry'
]

Running tests

Clone the repository, then:

npm install
# requires node >= 6.0.0
npm test