Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit 65e6759

Browse files
authored
Merge pull request #32 from willdady/master
Exposed file pattern as option
2 parents ef10636 + 9a27908 commit 65e6759

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ metalsmith.use(postcss({
3838
}));
3939
```
4040

41+
By default, files with `.css` extension will be parsed. This may be overridden
42+
by providing a custom pattern e.g.
43+
44+
```js
45+
metalsmith.use(postcss({
46+
pattern: '*.postcss',
47+
plugins: { ... }
48+
}));
49+
```
50+
4151
## Metalsmith CLI
4252

4353
Using the Metalsmith CLI, just add the postcss package name,

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function main(options) {
3030
var processor = postcss(plugins);
3131

3232
return function (files, metalsmith, done) {
33-
var styles = Object.keys(files).filter(minimatch.filter('*.css', { matchBase: true }));
33+
var styles = Object.keys(files).filter(minimatch.filter(options.pattern || '*.css', { matchBase: true }));
3434

3535
if(styles.length == 0) {
3636
done();

0 commit comments

Comments
 (0)