rotundasoftware / parcelify

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

Multiple scss files in same directlory? #36

Closed ichabodcole closed 9 years ago

ichabodcole commented 9 years ago

Is it possible to have multiple scss files in the same component directory? I using the sass-css-stream transform, but currently getting an error when there is more than one scss file in a single directory, though nesting the scss file in a sub-directory works fine, and multiple css files in single directory are also fine.

This is the most relevant part of the error I'm seeing.

events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: {
  "status": 3,
  "message": "File context created without an input path"
}

Additionally can you recommend a way to handle errors that occur during the sass-css transform? Right now any major sass errors kill my running watch tasks vs just reporting the errors.

ichabodcole commented 9 years ago

Well that was a dumb one (need more sleep apparently). Just needed to actually put some content in the additional scss files, was getting the error when I would add a new scss file without any content in it.

Still having an issue with not being able to keep sass errors from killing my watch task though. I've have on('error', ...) events, but at least in my configuration they are not helping to resolve this.

dgbeck commented 9 years ago

Hi @ichabodcole , are you are watching with watchify or some other mechanism?

ichabodcole commented 9 years ago

Hey @dgbeck this is happening while just using the watch option in parcelify alone. I have a setup similar to the below. If I update a scss file that is being watched, and it has an error in it, I get an un-handled event error that breaks the watch. I also never get the error message from parcelify logged out either, so as in the below case "oops parcelify errored" is never logged. I just get what looks like perhaps a node-sass error message detailing the offending sass issue.

parcelify(b, {
    watch: true,
    bundles: {
        style: bundleDest
    }
})
.on('error', function(err) {
    console.log('oops parcelify errored', err);
    this.emit('end');
})
dgbeck commented 9 years ago

Hi @ichabodcole . Thanks! I was able to reproduce this issue. It looks we were using an old version of stream-combiner that was not propagating errors correctly to the combined stream. Can you try upgrading to parcelify v1.1.2, just pushed, and see if that fixes the issue?

ichabodcole commented 9 years ago

Hey @dgbeck I upgraded, but am afraid I'm still getting the breaking error. I will keep poking about and see if I can provide any more info. FYI, this repo has my testing setup if that helps at all https://github.com/ichabodcole/Gulp-Browserify-Parcelify

ichabodcole commented 9 years ago

@dgbeck I just noticed that in v1.1.2 the stream-combiner package version is still at 0.0.4, should that have been bumped? I bumped it to the latest version 0.2.2 locally and it fixed the issue I was having with the watch breaking on sass errors.

dgbeck commented 9 years ago

Thanks @ichabodcole . That was a big help. package.json has now been updated properly in v1.1.3!

ichabodcole commented 9 years ago

@dgbeck Awesome! Has this version been published to npm (not seeing it yet)?

dgbeck commented 9 years ago

Done ;)

ichabodcole commented 9 years ago

TY!