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(plugin-webpack): allow specifing a seperate webpack config for your preload #2679

Merged
merged 2 commits into from
Feb 3, 2022

Conversation

kyruzic
Copy link
Contributor

@kyruzic kyruzic commented Jan 10, 2022

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

Allows you to specify a seperate webpack config for the preload process. This is 100% necessary in order to use react refresh see:
#1936
pmmmwh/react-refresh-webpack-plugin#263

There is a pr open for this currently but the author appears to have abandoned it. This is blocking me so lets get this fixed. I am happy to write documentation for it if needed.

const rendererWebpackConfig = await generator.getRendererConfig(config.renderer.entryPoints);
// Our preload config plugins is an empty list while our renderer config plugins has a member
expect(preloadWebpackConfig.name).to.equal('preload');
expect(rendererWebpackConfig.name).to.equal('renderer');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test verifies that the preload webpack config is used if it is specified by setting the property name on the renderer config and preload config and verifying that the name is as expected on each.

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.

2 participants