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

compile files imported with globbing #46

Closed
mistercoffee66 opened this issue Mar 13, 2017 · 6 comments
Closed

compile files imported with globbing #46

mistercoffee66 opened this issue Mar 13, 2017 · 6 comments

Comments

@mistercoffee66
Copy link

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
Copy link
Contributor

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

@mistercoffee66
Copy link
Author

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

@denysdovhan
Copy link
Contributor

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

@shvaikalesh
Copy link
Contributor

Hey @samelwitt, try es128/progeny#35.

@mistercoffee66
Copy link
Author

@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
Copy link
Author

@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.

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