Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-sass-import

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-sass-import

Allows recursive import of SCSS components from local and/or node_modules directories using npm's module resolving algorithm

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
537
increased by6.13%
Maintainers
1
Weekly downloads
 
Created
Source

node-sass-import

npm Build Status Coverage Status js-standard-style

Allows recursive import of SCSS components from local and/or node_modules directories using npm's module resolving algorithm. Without the need for tildes(~) to import from node_modules. Allows usage of @import "some-sass-npm-module" akin to require("some-npm-module") in node.js

Install

$ npm install --save node-sass-import

Usage

Used in conjunction with node-sass. In a simple npm-only build setup, the example below in package.json should suffice.

{
  "name": "your-package",
  "description": "fun package",
  "main": "index.js",
  "scripts": {
    "build-css": "node-sass test.scss dist/test.css --importer node_modules/node-sass-import"
  }
}

You can now build your scss files as follows

$ npm run build-css

Example

@import in sass can now be used just like a require statement. The example below imports the main scss file from the newsapps-syles npm module. At build time, all @import statements will be resolved locally or like npm modules. Also includes import support for partial scss files e.g. _partial.scss

@import "newsapps-styles";

.some-style {
  color: $primary-blue;
}

API

Version 2+ supports Node 6+ and npm 2+

License

2016 MIT © Emmanuel (Manny) Narh

Keywords

FAQs

Package last updated on 08 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc