Dylan
Dylan

Reputation: 13922

Is it possible to use browserify-css with factor-bundle?

Let's say I have a directory setup like

app
 \ page1
   - page1.js
   - page1.css
 \ page2
   - page2.js
   - page2.css
 \ fancy-widget
   - fancy-widget.js
   - fancy-widget.css
 \ common
   - shared-utils.js
   - general-styles.css

and I want output like

- page1.js
- page1.css
- page2.js
- page2.css
- shared.js
- shared.css

where the "shared" js/css files contain the scripts/styles that are required by both page1 and page2.

I'm able to use factor-bundle to satisfy the javascript side of my requirement, but I haven't been able to make browserify-css play nicely with it. I found the onFlush option for browserify-css, but it seems to be called for every js file that makes a css require call, as opposed to once per factored bundle file.

Is it possible to accomplish this "factor-bundle-css" functionality as described above?

Upvotes: 1

Views: 216

Answers (1)

Dylan
Dylan

Reputation: 13922

I ended up finding an alternative to browserify-css.

css-concatify claims that it

Supports Factor-Bundle w/o any configuration changes.

Upvotes: 1

Related Questions