PostCSS runner plugin
npm install karma-typescript-postcss-transform> Karma-Typescript :heart: PostCSS
This plugin is a generic PostCSS runner, which transforms CSS with JavaScript on the fly when running tests with karma-typescript.
```
$ npm install --save-dev karma-typescript-postcss-transform
In the karma-typescript section of karma.conf.js:
`javascript`
karmaTypescriptConfig: {
bundlerOptions: {
transforms: [
require("karma-typescript-postcss-transform")([require("some-plugin")])
]
}
}
Custom options can be passed to the runner in the first argument when calling the plugin:
- An array of PostCSS plugins
- PostCSS options. Optional, but the properties tofrom
and are _always_ set to the filename of the CSS file automatically.RegExp
- A object to filter which files should be processed./\.css$/
Optional, defaults to .
An example using the plugin autoprefixer with inline sourcemaps and a RegExp filter:
`javascript``
karmaTypescriptConfig: {
bundlerOptions: {
transforms: [
require("karma-typescript-postcss-transform")(
[require("autoprefixer")], { map: { inline: true } }, /\.css$/
)
]
}
}
This software is licensed with the MIT license.
© 2016-2021 Erik Barke, Monounity