gulp-react-rails-style

0.1.0 • Public • Published

gulp-react-rails-style

gulp plugin to statically process React on Rails components into CSS files.

Usage

var gulp = require("gulp");
var R = require("react-rails");
var style = require("gulp-react-rails-style")(R, [R.Style.Processors.autoprefixer, R.Style.Processors.min]);

gulp.task("style", function() {
    return gulp.src(["tests/**/*.js"])
    .pipe(style())
    .pipe(gulp.dest("tests/"));
});

There is an optional argument, cachebust, which allows to clear the require cache for a specific module path. It is useful when used in conjunction with gulp.watch. Assume all your components depend on a dist/styles module which contains your color swatches, etc. Then use:

gulp.task("style", function() {
    return gulp.src(["test/**/*.js"])
    .pipe(style("dist/styles"))
    .pipe(gulp.dest("tests/"));
});
...
gulp.watch("tests/**/*.js", ["style"]);

cachebust can be null (default), a string, or on array of strings.

/gulp-react-rails-style/

    Package Sidebar

    Install

    npm i gulp-react-rails-style

    Weekly Downloads

    2

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • elie.rotenberg