Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

getDependencies does not respect sass load paths #47

Closed
Kagami opened this issue Feb 16, 2014 · 3 comments
Closed

getDependencies does not respect sass load paths #47

Kagami opened this issue Feb 16, 2014 · 3 comments

Comments

@Kagami
Copy link

Kagami commented Feb 16, 2014

For example, given this folder structure:

.
├── app
│   ├── bundles
│   │   └── bundle.sass
│   └── components
│       └── _component.sass
└── brunch-config.coffee

, have this in the bundle.sass:

@import "app/components/component"

and this in the brunch-config.coffee:

files:
  stylesheets:
    joinTo:
      "static/app.css": /^app\/bundles\/bundle\.sass$/

the app.css doesn't get recompiled on _component.sass change. It also doesn't get recompiled if I add some load path to sass and make import path in bundle.sass relative to it. But everything is ok if import path is "../components/component".

I add some debugging to getDependencies function in sass-brunch and it's third argument (callback) is being called with:

{ '0': null,
  '1': 
   [ 'app/bundles/app/components/component.sass',
     'app/bundles/app/components/_component.sass',
     'app/bundles/app/components/component.scss',
     'app/bundles/app/components/_component.scss' ] }

Not sure is it sass-brunch usage of progeny issue or progeny issue itself, but it would be nice to have this working properly.

@ahacking
Copy link

Im having similar issue, a change to ANY @import (file has leading underscore) does not trigger a rebuild of app.css.

I ran brunch as follows:

DEBUG=brunch:* brunch watch

I get the following output if I touch app.scss:

brunch:pipeline Reading 'app/styles/app.scss' +14s
  brunch:watch File 'app/styles/app.scss' received event 'change' +14s
  brunch:pipeline Linting 'app/styles/app.scss' +0ms
  brunch:pipeline Compiling 'app/styles/app.scss' with 'SassCompiler' +0ms
  brunch:pipeline getDependencies 'app/styles/app.scss' with 'SassCompiler' +64ms
  brunch:file-list Compiled file 'app/styles/app.scss'... +14s
  brunch:generate Concatenating app/styles/app.scss to public/css/app.css +14s
  brunch:common Writing file 'public/css/app.css' +14s
  brunch:common Writing file 'public/css/app.css.map' +2ms
12 Mar 09:10:04 - info: compiled app.scss into app.css in 139ms

However if I touch an ``_variables.scss` which is imported by app.sccs, all I see is this:

  brunch:file-list Compiling dependency 'app/styles/_variables.scss' parent(s) +5.0m
  brunch:watch File 'app/styles/_variables.scss' received event 'change' +5.0m

That just looks wrong to me, it seems the imported file is not being registered as a dependency of app.scss, it shouldn't be compiling _variables.scss all but instead triggering a compile of app.scss

@es128
Copy link
Member

es128 commented Mar 12, 2014

@ahacking I don't think this is the same as the original issue. The message says that it is compiling the dependency's parent(s), which would appear correct. If nothing happens after those two log lines then there may be a different problem than missing the alternate load paths.

@ahacking
Copy link

Well I figured there could be a common defect because I can't get dependencies to trigger compilation of the parent in any situation.

I just don't have time to investigate further but thought the trace may lead to some insight as brunch is currently not really performing as advertised with respect to Sass.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants