Ensure a separate webpack instance is created for different loader options#1104
Merged
Conversation
…ions are used Add execution test for this behaviour
Member
|
Looks like you've a lint issue? |
Member
|
This is awesome work! Thank you! 🥰 Could you update the version number in the |
johnnyreilly
requested changes
May 11, 2020
| # Changelog | ||
|
|
||
| ## v7.0.4 | ||
| * [Ensure a separate webpack instance is created for different loader options](https://github.com/TypeStrong/ts-loader/pull/1104) - @appzuka |
Member
There was a problem hiding this comment.
Can you thank yourself please? It's traditional now 🤗
Member
|
Shipping with https://github.com/TypeStrong/ts-loader/releases/tag/v7.0.4 Thanks for your help 🤗🌻 |
Member
Author
|
I am pleased to be able to help. If there are other issues you don't have time to look into, in this or other repos, please let me know and I'll investigate when I have some time. |
Member
|
Thanks @appzuka! All help is always gratefully received 🥰 There's always issues and I'm massively time poor. If you should spot something that catches your eye, do feel free to have a go! Thanks again 😊 |
berickson1
pushed a commit
to berickson1/ts-loader
that referenced
this pull request
May 22, 2020
…tions (TypeStrong#1104) * Ensure a separate webpack instance is created if different loader options are used Add execution test for this behaviour * Fix import order (lint error) * Update version to 7.04 and include in changelog * Tweak to Changelog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch automatically creates a new webpack instance if ts-loader is invoked with different loader options.
This behaviour could be created manually by including the 'instance' option on each loader, but it is easy to miss that this is necessary. My application failed with update 7.0.0 because I used 2 different sets of options and did not appreciate that the second set would be ignored unless I specified a different instance string.
This update tags the instance with a hash of the options specified and will create a new instance if the hashes do not match. This behaviour will function even if the options specified are functions, such as getCustomTransformers.
A new execution test, loaderOptions, has been added to test this functionality.