Skip to content

Commit bb9de87

Browse files
committed
Add stdin
1 parent 7eced70 commit bb9de87

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ export default {
1717
}
1818
],
1919
plugins: [builtins(), resolve(), flow(), commonjs(), babel()],
20-
external: ["postcss", "postcss-selector-parser"],
20+
external: ["postcss", "postcss-selector-parser", "fs"],
2121
sourceMap: false
2222
}

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class Purgecss {
7474
// Get css selectors and remove unused ones
7575
let files = []
7676
for (let file of this.options.css) {
77+
const cssContent = this.options.stdin ? file : fs.readFileSync(file, 'utf8')
7778
files.push({
7879
file,
7980
css: this.getSelectorsCss(cssContent, cssClasses)

0 commit comments

Comments
 (0)