# postcss-strip-inline-comments

> Strip inline comments using the postcss-scss parser

Latest version **0.1.5** (published 2016-07-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-strip-inline-comments
pnpm add postcss-strip-inline-comments
yarn add postcss-strip-inline-comments
bun add postcss-strip-inline-comments
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2016-07-14 |
| First published | 2016-03-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 32 |
| Author | Mummybot |
| Maintainers | mummybot |
| Keywords | css, postcss, postcss-syntax, comments, scss, sass |

## Links

- npm: https://www.npmjs.com/package/postcss-strip-inline-comments
- Repository: https://github.com/mummybot/postcss-strip-inline-comments
- Homepage: https://github.com/mummybot/postcss-strip-inline-comments#readme
- Issues: https://github.com/mummybot/postcss-strip-inline-comments/issues
- npm.io page: https://npm.io/package/postcss-strip-inline-comments

## Dependencies (1)

- [postcss](https://npm.io/package/postcss.md) ^5.0.18

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.1.5 (latest) — 2016-07-14
- 0.1.4 — 2016-07-07
- 0.1.3 — 2016-03-11
- 0.1.2 — 2016-03-11
- 0.1.1 — 2016-03-10
- 0.1.0 — 2016-03-10

## README

# PostCSS strip inline comments [![Build Status](https://travis-ci.org/mummybot/postcss-strip-inline-comments.svg?branch=master)](https://travis-ci.org/mummybot/postcss-strip-inline-comments)

<img align="right" width="95" height="95"
     title="Philosopher’s stone, logo of PostCSS"
     src="http://postcss.github.io/postcss/logo.svg">

A plugin to remove inline CSS comments from compilation.

```scss
/* This comment will remain */
// This comment will be removed
body {
    // This comment will also be removed
    background-color: black;
}
// And so will this one
```

## Usage

You need to have a compliant parser, currently either [postcss-scss](https://github.com/postcss/postcss-scss) or [sugarss](https://github.com/postcss/sugarss) already parsing your postcss for this plugin to work.

###Install

```npm install postcss-strip-inline-comments --save-dev```

###Grunt

```javascript
grunt.initConfig({
  postcss: {
    options: {
      processors: [
        require('postcss-strip-inline-comments'),
      ],
      syntax: require('postcss-scss')
    },
    dist: {
      src: 'css/*.css'
    }
  }
});
```

###Gulp

```javascript
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var stripInlineComments = require('postcss-strip-inline-comments');
var scss = require('postcss-scss');

gulp.task('default', function () {
    var processors = [stripInlineComments];
    return gulp.src('in.css')
        .pipe(postcss(processors, {syntax: scss}))
        .pipe(gulp.dest('out'));
});
```

###Webpack

```javascript
var stripInlineComments = require('postcss-strip-inline-comments');

var config = {
  ...

  module: {
    loaders: [
      { 
        test: /\.s?css$/,
        loader: ExtractTextPlugin.extract('style-loader', 'css-loader?sourceMap&importLoaders=1!postcss-loader?parser=postcss-scss')
      }
    ]
  },
  postcss: function(webpack) {
    return [
      stripInlineComments
    ];
  },
  ...
}
```

###Node

```javascript
import postcss from 'postcss';
import syntax from 'postcss-scss';
import stripInlineComments from 'postcss-strip-inline-comments';

let css = fs.readFileSync('style.css', 'utf8');

postcss([stripInlineComments]).process(css, { parser: syntax }).then( result => {
    console.log(result.css);
});
```

---
_Source: https://npm.io/package/postcss-strip-inline-comments · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
