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

Check if regex and regex.test is available before calling it #608

Merged
merged 3 commits into from
Nov 9, 2016
Merged

Check if regex and regex.test is available before calling it #608

merged 3 commits into from
Nov 9, 2016

Conversation

kitze
Copy link
Contributor

@kitze kitze commented Nov 8, 2016

Trying to fix #607

@arunoda
Copy link
Member

arunoda commented Nov 8, 2016

We need to do this.
But I wanna know about the real cause of the #607 .
Could you reply to my comment on #607?

@kitze
Copy link
Contributor Author

kitze commented Nov 8, 2016

@arunoda just replied.

Copy link
Member

@arunoda arunoda left a comment

Choose a reason for hiding this comment

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

After that, we are good to go.

@@ -11,7 +11,17 @@ const logger = console;
export function addJsonLoaderIfNotAvailable(config) {
const jsonLoaderExists = config.module.loaders.reduce(
(value, loader) => {
return value || [].concat(loader.test).some(regex => regex && regex.test && regex.test('my_package.json'));
return value || [].concat(loader.test).some((loader) => {
Copy link
Member

Choose a reason for hiding this comment

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

Could you rename this loader name into something like matcher.
Like this:

return value || [].concat(loader.test).some((matcher) => { ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@arunoda done!

@arunoda
Copy link
Member

arunoda commented Nov 9, 2016

Awesome.

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