-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use rework plugins #8
Comments
The preprocessor is just a wrapper around rework-suit and autoprefixer, so if you use those directly you can add in other rework plugins. Here's an example I've used in var gulp = require('gulp');
var rework = require('gulp-rework');
var autoprefixer = require('gulp-autoprefixer');
var reworkAt2x = require('rework-plugin-at2x');
var reworkSuit = require('rework-suit');
gulp.task('suit', function() {
return gulp.src('*.css')
.pipe(rework(
reworkSuit(),
reworkAt2x()
))
.pipe(autoprefixer())
.pipe(gulp.dest('built/'));
}); |
So there isn't a way to use var autoprefixer = require('autoprefixer');
var rework = require('rework');
var suit = require('rework-suit');
var colors = require('rework-plugin-colors');
var at2x = require('rework-plugin-at2x');
var inherit = require('rework-inherit');
var fs = require('fs');
var browserConfig = [
'Explorer >= 9',
'last 2 Chrome versions',
'last 2 Firefox versions',
'last 2 Safari versions',
'last 2 iOS versions',
'Android 4'
];
var css = fs.readFileSync('index.css','utf8');
var bundle = rework(css, { source: 'index.css' })
.use(suit({ source: 'index.css' }))
.use(inherit())
.use(colors())
.use(at2x())
.toString({ sourcemap: true });
bundle = autoprefixer(browserConfig).process(bundle).css;
fs.writeFileSync('bundle.css', bundle); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it possible to use other rework plugins along with this preprocessor ?
Plugins like:
https://github.com/reworkcss/rework-plugin-at2x/
https://github.com/reworkcss/rework-plugin-inline
Couldn't find this info anywhere.
The text was updated successfully, but these errors were encountered: