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): better merge for configs and fallback for async plugins #874

Merged
merged 2 commits into from Nov 28, 2021

Conversation

Anber
Copy link
Collaborator

@Anber Anber commented Nov 28, 2021

Motivation

Fixes #855 and regression from #830

Summary

In #830 we decided to use the whole Webpack configuration in Linaria's resolver. It appeared, that it wasn't the wisest decision because it introduced a lot of breaking changes. This PR introduces a better merge for Webpack config with default Linaria's config and adds a fallback if Webpack configuration breaks the resolver by using some async plugins.

@Anber Anber merged commit ad84d6d into master Nov 28, 2021
@Anber Anber deleted the issue/855 branch November 29, 2021 06:41
// However there seems to be no other way to access webpack's resolver
// There is this.resolve, but it's asynchronous
// Another option is to read the webpack.config.js, but it won't work for programmatic usage
// This API is used by many loaders/plugins, so hope we're safe for a while
Copy link

Choose a reason for hiding this comment

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

this._compilation is undefined in the latest webpack

Copy link

Choose a reason for hiding this comment

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

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.

Webpack error with imported variables
2 participants