davidguttman / sassify

Require scss files in Browserify
MIT License
51 stars 22 forks source link

Output to .css #42

Open peterbarraud opened 6 years ago

peterbarraud commented 6 years ago

Is it possible to output multiple .scss require statements in the entry.js to a .css or even a single .scss file. Something like:

    var b = require('browserify')();
    b.add('entry.js');
    b.transform('sassify', {
        global: true,
        'auto-inject':false
    });
    var indexjs = fs.createWriteStream('build/index.css');
    b.bundle().pipe(indexjs);

Maybe:

    var b = require('browserify')();
    .add('index.js')
    .transform(require('browserify-css'), {
        global:true,
        "minify": true,
        onFlush: function(options, done) {
            fs.appendFileSync('build/index.css', options.data);
            // Do not embed CSS into a JavaScript bundle
            done(null);
        }
    })
    .bundle();
davidguttman commented 6 years ago

Sure, I'd accept a PR for this, thanks!

peterbarraud commented 6 years ago

I get this remote: Permission to davidguttman/sassify.git denied to peterbarraud.

Anything I need to do.

davidguttman commented 6 years ago

You should be able to fork and then push to your fork.