postcss-rm-imports

remove or comment out @import statements

postcss-rm-imports

Comments out or removes @import statements. Useful for build processes.

npm install postcss-rm-imports
var postcss = require("postcss")
var rmImports = require("postcss-rm-imports")
 
var css = postcss()
  .use(rmImports({
    remove: false
  }))
  .process(cssString)
  .css

By default, it will simply comment-out @import statements. If you would like it to remove the @import statements, set remove: true as an option.