0.1.0 • Published 10 years ago
karma-autoprefixer-preprocessor v0.1.0
karma-autoprefixer-preprocessor
A Karma plugin. Add vendor prefix on the fly by autoprefixer.
Installation
npm install karma-autoprefixer-preprocessor --save-dev
Configuration
The simplest configuration
You just need to declare what files should be autoprefixerred
// karma.conf.js
module.exports = function(config) {
config.set({
preprocessors: {
'**/*.css': ['autoprefixer']
}
});
};
Working together with karma-less-preprocessor
less
runs first and thenautoprefixer
runs with generated css files beforemultiple preprocessors run in specified order
// karma.conf.js
module.exports = function(config) {
config.set({
preprocessors: {
'**/*.less': ['less', 'autoprefixer']
}
});
};
Following code shows the all possible configurations
// karma.conf.js
module.exports = function(config) {
config.set({
preprocessors: {
'**/*.css': ['autoprefixer']
},
autoprefixerPreprocessor: {
// options passed to the autoprefixer
options: {
// there is only browsers configuration if default one doesn't match your requirement
browsers: ['last 2 versions', 'ie 8', 'ie 7', 'ff 10']
},
// transforming the filenames, you don't have to override transformPath usually
transformPath: function(path) {
return path.replace(/\.css$/, '.autoprefixer.css');
}
}
});
};
For more information on Karma see the homepage.