Skip to content

Added support for using an ES6 default exported function for configuration#2118

Merged
sokra merged 5 commits intowebpack:masterfrom
johanneslumpe:patch-1
Mar 11, 2016
Merged

Added support for using an ES6 default exported function for configuration#2118
sokra merged 5 commits intowebpack:masterfrom
johanneslumpe:patch-1

Conversation

@johanneslumpe
Copy link
Copy Markdown
Contributor

No description provided.

Allow usage of ES6 default exported function for config
Removed old code
@johanneslumpe
Copy link
Copy Markdown
Contributor Author

Solves #2105

Comment thread bin/convert-argv.js Outdated
}

if(typeof options === "function") {
var isES6DefaultExportedFunc = (typeof options === "object" && typeof options["default"] === "function");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a check for null?

var isES6DefaultExportedFunc = (options && typeof options === "object" && ...

Maybe also a few lines below in my code. I've done the same mistake ;)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha ;) Will add that later today!

Comment thread bin/convert-argv.js Outdated

if(typeof options === "function") {
var isES6DefaultExportedFunc = (
typeof options === "object" && options !== null && typeof options["default"] === "function"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options["default"] should be rewritten as options.default, it's just cleaner that way

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@johanneslumpe
Copy link
Copy Markdown
Contributor Author

@sokra Is anything missing here?

sokra added a commit that referenced this pull request Mar 11, 2016
Added support for using an ES6 default exported function for configuration
@sokra sokra merged commit b0fffd5 into webpack:master Mar 11, 2016
@sokra
Copy link
Copy Markdown
Member

sokra commented Mar 11, 2016

Thanks

@johanneslumpe johanneslumpe deleted the patch-1 branch May 6, 2016 07:19
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