* Synchronously transforms a css string using postcss. * @param {string} cssStr the css text to transform * @param {!Object=} opt_cssnano cssnano options * @param {!Object=} opt_filename the filename of the file being transformed. Used for sourcemaps generation. * @return {object} The transform
(cssStr, opt_cssnano, opt_filename)
| 14 | * @return {object} The transformation result |
| 15 | */ |
| 16 | function transformCssSync(cssStr, opt_cssnano, opt_filename) { |
| 17 | if (!syncTransformer) { |
| 18 | syncTransformer = require('sync-rpc')(__dirname + '/init-sync'); |
| 19 | } |
| 20 | return syncTransformer(cssStr, opt_cssnano, opt_filename); |
| 21 | } |
| 22 | |
| 23 | module.exports = { |
| 24 | transformCssSync, |