Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options handling if multiple input/output paths are used. #29

Merged
merged 3 commits into from
Oct 22, 2015
Merged

Options handling if multiple input/output paths are used. #29

merged 3 commits into from
Oct 22, 2015

Conversation

mkempe
Copy link
Contributor

@mkempe mkempe commented Oct 21, 2015

Hey there,

if you use multiple input/output paths with ember-cli-less, multiple instances of LESSCompiler (broccoli-less-single) are created:

var trees = Object.keys(paths).map(function(file) {
  var input  = path.join(inputPath, file + '.' + ext);
  var output = paths[file];

  return new LESSCompiler([tree], input, output, options);
});

The problem: The options are shared / overridden by the last instance, respectively all instances have the same options. This results in the problem, that multiple Source Maps with the same name are created.

For example:

var app = new EmberApp(defaults, {
  outputPaths: {
    app: {
      html: 'index.html',
      css: {
        'foo': '/assets/foo.css',
        'bar': '/assets/bar.css'
      },
      js: '/assets/app.js'
    },

    // ...
  },

  // ...
};

For /assets/bar.css a Source Map with the name /assets/foo.css.map is created instead of /assets/bar.css.map.

I fixed the problem, but i do not really understand, why this happens , and if this is the right solution.

@mkempe mkempe changed the title Error in options handling. Options handling if multiple input/output paths are used. Oct 21, 2015
@knownasilya
Copy link
Contributor

Looks great, and works as expected.

@jasonmit
Copy link
Collaborator

Ok I will review both ember cli less and your changes tonight to get a better understanding. Thanks!

@mkempe
Copy link
Contributor Author

mkempe commented Oct 21, 2015

Hey Jason,

thanks for looking into.

PS: I merged the latest changes in.

@jasonmit
Copy link
Collaborator

Okay, I have a better understanding of the change. I'm all for not mutating objects that are passed in. Thanks for the PR, I will version accordingly in case people relied on this bug.

@jasonmit
Copy link
Collaborator

Thanks again 👍

jasonmit added a commit that referenced this pull request Oct 22, 2015
Options handling if multiple input/output paths are used.
@jasonmit jasonmit merged commit 1171d30 into gabrielgrant:master Oct 22, 2015
@jasonmit
Copy link
Collaborator

Versioned as 0.5.0

@mkempe
Copy link
Contributor Author

mkempe commented Oct 22, 2015

Nice! Thanks again Jason for looking over and the new release.

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

Successfully merging this pull request may close these issues.

3 participants