rotundasoftware / parcelify

Add css to your npm modules consumed with browserify.
MIT License
251 stars 20 forks source link

parcelify not working properly even if it finds the styles #15

Closed alessioalex closed 9 years ago

alessioalex commented 9 years ago

parcelify1

general.js:

// defined dependencies
var $ = require('jquery');
// hacg for other libs
window.jQuery = $;
var bootstrap = require('bootstrap');
var moment = require('moment');
alessioalex commented 9 years ago

As you can see, there is no build.css file. Any tips on this? I'm testing on Windows 7.

alessioalex commented 9 years ago

@dgbeck do you have time to take a look at this as well? I am debugging this now, but would appreciate any help :) thanks!

dgbeck commented 9 years ago

I'm not seeing the contents of the build directory listed in above output. Is build.css hiding in there? (Fingers crossed.)

alessioalex commented 9 years ago

@dgbeck that's the whole point, it's not :( The fact is that when you require Bootstrap it does find the css file, but somehow the asset read stream does not end (which in turn does not call the async callback, etc).

I'm not sure why the stream does not emit end. I've tried to debug this by piping into stdout and it works. Really weird.

Just do require('bootstrap') in your parcelify example. You should replicate this.

dgbeck commented 9 years ago

ok.

Just do require('bootstrap') in your parcelify example. You should replicate this.

That's good news. If we can reproduce it we can fix it. Can you please confirm this issue is reproducible in the way that you describe and also be a little more specific about steps to reproduce? (e.g. Which parcelify example exactly, where should the require('bootstrap') go? What version of bootstrap?) If you can help with the reproducing we take care of the fixing.

Thanks!

alessioalex commented 9 years ago

Just copy any regular project that you are using parcelify with, install bootstrap (latest) and require it in your main file. Try to run parcelify afterwords.

dgbeck commented 9 years ago

You are indeed correct sir. Looks like this has to do with the readable stream of the bootstrap.css file hitting its high water mark and getting paused since the pipeline does not terminate with a writable stream. Should have a fix for your shortly that pipes the bundle to a writable file stream before the individual assets streams are piped to the bundle.

dgbeck commented 9 years ago

k just published version 0.12.5 with this fix incorporated.

9cbafbead9ff249e9a9be4e7248e89817db98ede

Thank you very much for spotting this issue and for the help in reproducing it and tracking it down! Your comment about trying to piping it to stdout for testing was very helpful!

alessioalex commented 9 years ago

Woah thanks so much for the quick fix! That's great!

În data de joi, 11 decembrie 2014, David Beck notifications@github.com a scris:

k just published version 0.12.5 with this fix incorporated.

9cbafbe https://github.com/rotundasoftware/parcelify/commit/9cbafbead9ff249e9a9be4e7248e89817db98ede

Thank you very much for spotting this issue and for the help in reproducing it and tracking it down! Your comment about trying to piping it to stdout for testing was very helpful!

— Reply to this email directly or view it on GitHub https://github.com/rotundasoftware/parcelify/issues/15#issuecomment-66669524 .

alessioalex commented 9 years ago

@dgbeck I confirm it works, thanks again.