egoist / egoist/rollup-plugin-postcss
Question: Use of 'include' option
- Dominant language
- JavaScript
- Stars
- 689
- Forks
- 210
- PR merge metrics
- No merged PRs in 30d
Description
I have the same problem as described in the issue #160. So i implemented the folllowing solution to generate the separated CSS :
```javascript
//rollup.config.js
const glob = require('glob')
const path = require('path')
const postcss = require('rollup-plugin-postcss')
const bundleCss = () => {
var config = []
var files = glob.sync(path.resolve(__dirname, '**/*.css'))
files.forEach(file => {
var filename = file.substr(file.lastIndexOf('/') + 1, file.length).toLowerCase()
config.push(
postcss({
include: file,
extract: path.resolve(`dist/${filename}`),
minimize: true
})
)
})
return config
}
modules.exports = {
plugins: [
...bundleCss()
]
}
```
It worked well, but i'm worried about the use of the option `include`. I didn't find information about this option in the docs, then i have some questions:
* There's a better (or the right) way to solve this problem?
* The `include` option will be supported in the future?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.