https://github.com/steditor/grunt-sass-tilde-importer
Resolve paths starting with ~ inside the node_modules directory for node-sass
https://github.com/steditor/grunt-sass-tilde-importer
Last synced: 30 days ago
JSON representation
Resolve paths starting with ~ inside the node_modules directory for node-sass
- Host: GitHub
- URL: https://github.com/steditor/grunt-sass-tilde-importer
- Owner: Steditor
- License: mit
- Created: 2016-05-30T10:09:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-01-30T16:58:50.000Z (over 7 years ago)
- Last Synced: 2024-10-16T06:34:37.525Z (7 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Grunt Sass Tilde Importer
### What you want to do
Import `sass`-stylesheets from a node module inside your application's `scss` file when using
[node-sass](https://github.com/sass/node-sass) via [grunt-sass](https://github.com/sindresorhus/grunt-sass).### What you would like to write
```scss
@import '~module_name/stylesheet';
```
e.g.
```scss
@import '~bootstrap-sass/assets/stylesheets/_bootstrap';
```
with the [bootstrap sass](https://github.com/twbs/bootstrap-sass) module.### What you have to do
Install this module with `npm install --save-dev grunt-sass-tilde-importer` and update your `Gruntfile`:
Require the module with
```js
const tilde_importer = require('grunt-sass-tilde-importer');
```
and add
`importer: tilde_importer` to the options of your [grunt-sass](https://github.com/sindresorhus/grunt-sass)-configuration.Thanks go to [Dominic Tobias](http://stackoverflow.com/a/37118406/1606867) who suggested this solution.