Skip to content

salesforce-ux/scss-inline-imports

SCSS Inline Imports Dependabot Status 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