Remove CSS comments from a string
npm i css-uncomment
CDN Links:
- https://cdn.jsdelivr.net/npm/css-uncomment@1.0.0/css-uncomment.js
- https://www.unpkg.com/css-uncomment@1.0.0/css-uncomment.js
// ES6
import cssUncomment from "css-uncomment";
// commonjs
const cssUncomment = require("css-uncomment");
const string = cssUncomment(`
/* start of my very cool css styling */
div {
color: red; /* changes color to red */
}
`);
console.log(string);