Load css and transform it using postcss
npm install rosid-handler-postcssLoad css and transform it using postcss
```
npm install rosid-handler-postcss
`js
const handler = require('rosid-handler-postcss');
handler('main.css').then(data => {});
handler('main.css', { optimize: true }).then(data => {});
`
install your Postcss plugins and add it to postcss.config.js
`js`
module.exports = {
plugins: {
precss: {}
}
};
Add the following object to your rosidfile.json, rosidfile.js or routes array. rosid-handler-postcss will transform all matching css files in your source folder using Postcss.
`json`
{
"name": "css",
"path": "[^_].css",
"handler": "rosid-handler-postcss"
}
`css`
/ main.css /
.class {
color: white;
+ .class 2 {
color: red;
}
}
`css`
/ main.css (output) /
.class {
color: white;
}
.class + .class 2 {
color: red;
}
- filePath {String} Absolute path to file.opts
- {?Object} Options. - optimize {?Boolean} - Optimize output. Defaults to false.
- {Promise