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

Allow --importRoot to override root config option #70

Merged
merged 1 commit into from
Dec 9, 2016

Conversation

simonsmith
Copy link
Member

This depends on the fix in #69 before the tests will pass. We could probably add a test for @casio's work in the same describe.

cc @giuseppeg

@giuseppeg
Copy link
Member

You could keep the original version and add an aliases map like so:

var optsAliases = {
  importRoot: 'root'
}

var flags = [
  'minify',
  'encapsulate',
  'root',
  'importRoot',
  'lint'
].reduce(function (accumulator, inFlag) {
  if (({}).hasOwnProperty.call(program, inFlag)) {
    var flag = optsAliases[inFlag] || flag
    accumulator[flag] = program[inFlag];
  }
  return accumulator;
}, {});

@simonsmith
Copy link
Member Author

I think that's a much cleaner solution. Will refactor after the other PR goes in

@giuseppeg giuseppeg mentioned this pull request Dec 7, 2016
@simonsmith
Copy link
Member Author

Updated

@giuseppeg giuseppeg merged commit 487a79e into master Dec 9, 2016
@giuseppeg giuseppeg deleted the normalise-root branch December 9, 2016 13:21
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.

None yet

2 participants