
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
postcss-strip-inline-comments
Advanced tools
Strip inline comments using the postcss-scss parser
A plugin to remove inline CSS comments from compilation.
/* This comment will remain */
// This comment will be removed
body {
// This comment will also be removed
background-color: black;
}
// And so will this one
You need to have a compliant parser, currently either postcss-scss or sugarss already parsing your postcss for this plugin to work.
###Install
npm install postcss-strip-inline-comments --save-dev
###Grunt
grunt.initConfig({
postcss: {
options: {
processors: [
require('postcss-strip-inline-comments'),
],
syntax: require('postcss-scss')
},
dist: {
src: 'css/*.css'
}
}
});
###Gulp
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
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
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);
});
0.1.5
FAQs
Strip inline comments using the postcss-scss parser
The npm package postcss-strip-inline-comments receives a total of 8,582 weekly downloads. As such, postcss-strip-inline-comments popularity was classified as popular.
We found that postcss-strip-inline-comments demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.