Socket
Book a DemoInstallSign in
Socket

postcss-scss-import-dedup

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-scss-import-dedup

PostCSS plugin to extract mixins, functions, imports

1.0.4
latest
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

postcss-scss-import-dedup

PostCSS plugin to remove duplicate @import statements.

Installation

With yarn

$ yarn add postcss-scss-import-dedup

Or npm:

$ npm install --save postcss-scss-import-dedup

Usage

const fs = require('fs'),
	postcss = require('postcss'),
	syntax = require('postcss-scss'),
	dedupImports = require('postcss-scss-import-dedup')
	
const scss = fs.readFileSync('scss/input.scss', 'utf-8')
	
postcss([dedupImports()]).process(scss, {
  syntax: syntax,
  from: 'scss/input.scss',
})

scss/input.scss:

@import 'a';
@import 'b';
@import 'a';

Will give you:

@import 'a';
@import 'b';

Options

opts.filter

A function that receives a an import string and determines if it should be tracked by the deduper. This can be used as an escape valve while using this plugin.

Default:

null

Example:

dedupImports({
	filter: importpath => {
		return importpath == 'a'
	}
})

Will dedup only @import 'a' statements.

For more information see the scss-extractor documentation.

Keywords

postcss

FAQs

Package last updated on 22 Mar 2019

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.