https://github.com/salesforce-ux/scss-inline-imports
A library to inline SCSS @import statements
https://github.com/salesforce-ux/scss-inline-imports
sass scss
Last synced: 5 months ago
JSON representation
A library to inline SCSS @import statements
- Host: GitHub
- URL: https://github.com/salesforce-ux/scss-inline-imports
- Owner: salesforce-ux
- License: bsd-3-clause
- Created: 2016-07-15T05:17:46.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-10-12T08:28:43.000Z (over 3 years ago)
- Last Synced: 2025-01-01T17:35:44.663Z (6 months ago)
- Topics: sass, scss
- Language: JavaScript
- Homepage:
- Size: 538 KB
- Stars: 1
- Watchers: 8
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# SCSS Inline Imports [](https://dependabot.com) [![Build Status][travis-image]][travis-url] [![NPM version][npm-image]][npm-url]
## Getting Started
```javascript
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:
```bash
npm install
# requires node >= 6.0.0
npm test
```[npm-url]: https://npmjs.org/package/scss-inline-imports
[npm-image]: http://img.shields.io/npm/v/scss-inline-imports.svg[travis-url]: https://travis-ci.org/salesforce-ux/scss-inline-imports
[travis-image]: https://travis-ci.org/salesforce-ux/scss-inline-imports.svg?branch=master