sighjs / sigh

multi-process expressive build system for the web and node.js, built using baconjs observables
209 stars 12 forks source link

Sass watch #49

Closed jmatsushita closed 8 years ago

jmatsushita commented 8 years ago

Hi there,

I'd like to catch events coming from any change in the sass tree, but the sass plugin needs to only run on the importing file. i.e.

site.scss
└─base
       └─ import.scss

sigh.js

  pipelines['build-css'] = [
    glob('**/*.*'),
    select({ projectPath : 'site.scss' }),
    sass(),
    write('css')
  ]

If I remove the select then the sass() plugin tries to build import.scss which it shouldn't and therefor erros. If I only glob site.scss then sigh doesn't rebuild when the import changes.

I tried configuring the sass plugin, using { data:null } to make it ignore the input then and ask the sass plugin to build only the site.scss file:

  pipelines['build-css'] = [
    glob('**/*.*'),
    sass({ file: 'site.scss', data:null}),
    select({ projectPath : 'site.css' }),
    write('css')
  ]

But with this the glob events don't seem to retrigger the sass build (if I modify base/import.scss the build isn't retriggered).

What can I do?

insidewhy commented 8 years ago

The glob is wrong, check the readme and the basePath option.

insidewhy commented 8 years ago

As for always forwarding the importing file... the sass plugin should probably handle that as there may be multiple importers etc.

jmatsushita commented 8 years ago

I wrote a simplified example which I haven't tested in order to make the problem appear more clearly. I do use basePath. I'll remind you that I also wrote a couple of plugins now and ask one of my colleagues to write one as well. And I have read the README a dozen times.

I really tried to use sigh as a potential more advanced alternative to other build systems, but I think I will leave it behind now because I ran into to many difficulties, either because there isn't enough documentation, not enough examples or the design isn't mature enough. Thanks for trying though.

insidewhy commented 8 years ago

It'll still be in beta for quite some time, thanks for trying it out!

insidewhy commented 8 years ago

Opened https://github.com/sighjs/sigh-sass/issues/1 for the sass thing. I think files that shouldn't appear in the output should be like _thiss.scss in sass.