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

Ensure a separate webpack instance is created for different loader options #1104

Merged
merged 4 commits into from
May 11, 2020
Merged

Conversation

appzuka
Copy link
Member

@appzuka appzuka commented May 10, 2020

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.

…ions are used

Add execution test for this behaviour
@johnnyreilly
Copy link
Member

Looks like you've a lint issue?

#1102 (comment)

@johnnyreilly
Copy link
Member

This is awesome work! Thank you! 🥰

Could you update the version number in the package.json and add an entry to the CHANGELOG.md please?

Copy link
Member

@johnnyreilly johnnyreilly left a comment

Choose a reason for hiding this comment

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

One tweak!

CHANGELOG.md Outdated
@@ -1,5 +1,8 @@
# Changelog

## v7.0.4
* [Ensure a separate webpack instance is created for different loader options](https://github.com/TypeStrong/ts-loader/pull/1104) - @appzuka
Copy link
Member

Choose a reason for hiding this comment

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

Can you thank yourself please? It's traditional now 🤗

@johnnyreilly johnnyreilly merged commit 1b84fed into TypeStrong:master May 11, 2020
@johnnyreilly
Copy link
Member

Shipping with https://github.com/TypeStrong/ts-loader/releases/tag/v7.0.4

Thanks for your help 🤗🌻

@appzuka
Copy link
Member Author

appzuka commented May 11, 2020

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.

@johnnyreilly
Copy link
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
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