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

Fix webpack config file name for react-scripts > 2.1.1 #1241

Merged
merged 7 commits into from Jan 17, 2019

Conversation

oterral
Copy link
Contributor

@oterral oterral commented Jan 7, 2019

Since react-scripts 2.1.1, the config file is named webpack.config.js instead of webpack.config.dev.js.

@codecov-io
Copy link

codecov-io commented Jan 7, 2019

Codecov Report

Merging #1241 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted Files Coverage Δ
src/scripts/utils/findUserWebpackConfig.js 100% <100%> (ø) ⬆️

@sapegin
Copy link
Member

sapegin commented Jan 14, 2019

Please have a look at the CI results.

@oterral
Copy link
Contributor Author

oterral commented Jan 14, 2019

@sapegin The build passed before I add tests. I m not sure how unit tests can breaks integration tests.
I need help on this.

Copy link
Member

@sapegin sapegin left a comment

Choose a reason for hiding this comment

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

Restart helps with that usually ;-)

src/scripts/utils/__tests__/findUserWebpackConfig.spec.js Outdated Show resolved Hide resolved
src/scripts/utils/__tests__/findUserWebpackConfig.spec.js Outdated Show resolved Hide resolved
src/scripts/utils/findUserWebpackConfig.js Outdated Show resolved Hide resolved
}
return a;
});
expect(result).toMatch(/^react-scripts\/config\/webpack\.config/);
Copy link
Member

Choose a reason for hiding this comment

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

This will also match webpack.config.dev. Probably should be something like /^react-scripts\/config\/webpack\.config.js$/.

@sapegin
Copy link
Member

sapegin commented Jan 15, 2019

Looks like there's no JS at the end. Actually, since it's not a real path.resolve we can just use .toBe() or .toMatchInlineSnapshot — no need for regexps in these tests.

    Expected value to match:
      /^react-scripts\/config\/webpack\.config\.js/
    Received:
      "react-scripts/config/webpack.config"

@oterral
Copy link
Contributor Author

oterral commented Jan 15, 2019

Didn't know about .toMatchInlineSnapshot . Seems a good way to go.

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

3 participants