Skip to content

Instantly share code, notes, and snippets.

@thomasboyt
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasboyt/9124622 to your computer and use it in GitHub Desktop.
Save thomasboyt/9124622 to your computer and use it in GitHub Desktop.

Let's say I have a Bower package called my-less. It depends on a LESS package called lesshat.

my-less's structre is this:

my-less/
  bower_components/   <- not checked in
    lesshat/
      lesshat.less
  main.less
  bower.json

bower.json contains the lesshat dependency. main.less looks like this:

@import "./bower_components/lesshat/main.less";

// ...

This all works fine when I'm working on the my-less package itself.

Then, I go to use my-less in my app, which looks like:

app/
  bower_components/
  styles/
    app.less

app.less looks like:

@import "../bower_components/my-less/main.less";

I run bower install, thinking that it should install my-less with its dependency. In an ideal world, this would look like:

app
  bower_components/
    my-less/
      bower_components/
        lesshat/
          lesshat.less
      main.less
  styles/
    app.less

app.less would import main.less, which would import lesshat.less, and everything would be gravy. In reality, though, Bower installs this like so:

app
  bower_components/
    my-less/
      main.less
    lesshat/
      lesshat.less
  styles/
    app.less

Meaning that main.less is unable to be imported, since it can't import lesshat.less.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment