brunch / less-brunch

Adds LESS support to Brunch
14 stars 18 forks source link

compile files imported with globbing #46

Closed mistercoffee66 closed 7 years ago

mistercoffee66 commented 7 years ago

Hi, thanks for your work on this plugin.

I'm using less-plugin-glob for some of my imports as follows:

// styles/main.less
@import "../../node_modules/normalize.less/normalize.less";
@import "_lib/neat/_less-neat";
@import "_vars";
@import "_mixins";
@import "_global";

@import "_components/**";

When brunch is watching, changes to the explicitly imported files compile but changes to the globbed files do not. The console does report that main.less is getting recompiled but the changes are not actually loaded in the browser. If I then manually edit main.less (adding/removing a comment or whatever) the globbed changes do load on compile.

my brunch config:

module.exports = {
  files: {
    javascripts: {
      joinTo: {
        'js/vendor.js': /^(?!app)/,
        'js/app.js': /^app/
      }
    },
    stylesheets: {
      joinTo: {
        'css/app.css': /^app\/styles\/main\.less/
      }
    }
  },

  plugins: {
    babel: {presets: ['es2015', 'react','stage-0']},
    browserSync: {
          port: 3000,
          logLevel: "debug"
    },
    less: {
      plugins: [require('less-plugin-glob')]
    }
  }
};

Any thoughts appreciated!

denysdovhan commented 7 years ago

Hi, @samelwitt! Thanks for reaching us out! Gonna take a look at this problem ASAP.

mistercoffee66 commented 7 years ago

Hi @denysdovhan, just checking to see if you had a chance to look. Thanks!

denysdovhan commented 7 years ago

@samelwitt yeah, I didn't forget about this issue. Just busy with other issues.

shvaikalesh commented 7 years ago

Hey @samelwitt, try https://github.com/es128/progeny/pull/35.

mistercoffee66 commented 7 years ago

@shvaikalesh Thanks, I'm not quite sure what you're proposing to try, unless it's a workaround? If that's the case, thanks but not needed in my case, I'm working around it fine.

@denysdovhan No worries, thanks!

mistercoffee66 commented 7 years ago

@shvaikalesh Sorry, now I see that I misunderstood, I wasn't looking carefully enough :/ Changing globDeps: true in progeny doesn't make sense, IMO, since LESS doesn't support globs by itself. But I tried it and didn't work in any case.

Anyway, I think the issue is that the progeny output of dependencies is what Brunch is watching, which is why the compilation works but doesn't happen unless the parent LESS file is directly changed.

Really the thing to do is to config Brunch to accept additional dependencies. So I'll close this as I think less-brunch itself is working correctly.