postcss-finding-dead-css
PostCSS plugin that help identifying the dead code. Idea. Only my plugin uses only the css border-image property.
Install
# the plugin yarn add -D postcss-finding-dead-css#or npm install --save-dev postcss-finding-dead-css
Input:
Output:
examples)
Usage (// Node.js 8.xconst readFileSync writeFileSync = ;const resolve = ;const postcss = ;const postcssDeadCss = ;const from to = "./input.css" "./output.css";const CSS = ;const PLUGINS = ; async { try const css messages = await ; messages ; console; ; catch e console; };
Options
deadApiUrl
, type: String
, required: false
default: '/cssdead'
Url to back-end api, I send two parametrs type
and file
type
- has json { selector, startLine, startColumn }
file
- path to source css file
url
, type: Function
, required: false
This function help you customize url generation
Middleware
example)
Usage (// Node.js 8.x// example get middlewares:const getMiddleware = ;const middlewareCheckDead middlewareStat = ; // Express.jsconst app = ; app;
Options
deadApiUrl: '/custom/path' // defualt: '/cssdead' statApiUrl: '/custom/path/stat' // defualt: '/getStat'