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

feat: support passing config to generateWebpackConfig for merging #343

Merged
merged 8 commits into from
Sep 5, 2023
Merged

feat: support passing config to generateWebpackConfig for merging #343

merged 8 commits into from
Sep 5, 2023

Conversation

G-Rath
Copy link
Contributor

@G-Rath G-Rath commented Aug 5, 2023

Summary

Enables providing generateWebpackConfig an optional object that is included in the config merge, reducing the amount of boilerplate code you have to write when doing basic customization to the config.

Pull Request checklist

  • Add/update test to cover these changes
  • Update documentation
  • Update CHANGELOG file

Other Information

Resolves #329

ahangarha
ahangarha approved these changes Aug 5, 2023
Copy link
Contributor

@ahangarha ahangarha left a comment

Choose a reason for hiding this comment

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

It's a good proposal with a clean implementation.

It would be good to update the current dummy app based on these changes.

✅ Added tests
✅ Updated Documentation
🚫 Updated Changelog

Please update the changelog.

@justin808 Should we prepare for 7.1.0?

@G-Rath G-Rath requested a review from ahangarha August 5, 2023 21:20
Copy link
Contributor

@ahangarha ahangarha left a comment

Choose a reason for hiding this comment

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

Thanks for applying the changes. It looks good.

We just have an issue with passing multiple configs. Check my comment.

spec/dummy/config/webpack/commonWebpackConfig.js Outdated Show resolved Hide resolved
package/index.js Show resolved Hide resolved
@G-Rath
Copy link
Contributor Author

G-Rath commented Aug 14, 2023

Thanks for the reviews - I'll action them in the next couple of weeks as I'm working on #349 right now

@justin808
Copy link
Member

@G-Rath Ping me when ready for review!

@G-Rath G-Rath requested review from ahangarha and justin808 August 31, 2023 21:27
// having a new object is essential.
module.exports = merge({}, baseWebpackConfig, options)
// This results in a new object copied from the mutable global
module.exports = generateWebpackConfig(options)
Copy link
Member

Choose a reason for hiding this comment

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

  1. It's not clear where to place this code. What file is this?
  2. With the new object rather than global, some people might get confused if they are migrating old code of multiple files that simply mutated the global object.

Copy link
Member

Choose a reason for hiding this comment

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

These changes might be fine as-is...just some thoughts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@justin808 I've reworded the documentation to make it clearer where the file lives. I'm not sure what you mean by your second point though?

@G-Rath G-Rath requested a review from justin808 August 31, 2023 23:46
Copy link
Member

@justin808 justin808 left a comment

Choose a reason for hiding this comment

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

LGTM. Merge?

@G-Rath
Copy link
Contributor Author

G-Rath commented Sep 3, 2023

Yup go for it! It would also be good to get released :)

package/index.js Outdated Show resolved Hide resolved
@justin808 justin808 merged commit 732ba01 into shakacode:master Sep 5, 2023
@G-Rath G-Rath deleted the webpack-merge-param branch September 5, 2023 20:55
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.

Support passing custom webpack config directly to generateWebpackConfig
3 participants