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

resolves svelte from node entrypoint & add support for overriding svelte location - fixes #109 #110

Closed
wants to merge 4 commits into from

Conversation

rixo
Copy link

@rixo rixo commented Aug 1, 2019

Uses require.main.require to resolve svelte from app entrypoint. This will use app's own svelte even when using a symlinked svelte-loader.

The last commit additionaly allows to provide svelte location directly with an env variable. This can be required by some external tools targeting svelte-loader, but have their own entrypoint outside of the main app (full disclosure: I need it for svelte-hmr-spec).

@benmccann benmccann linked an issue Sep 4, 2020 that may be closed by this pull request
@benmccann
Copy link
Member

@rixo is this still helpful to you if we merge the svelte-loader-hot stuff in here? If so, this PR will need to be rebased

@rixo
Copy link
Author

rixo commented Jan 15, 2021

I guess it would still be useful but, in hindsight, I've learnt this was a recurring problem when developing multiple linked packages locally. Nowadays I would rather try to address this by hacking the Svelte dependency from the outside, with something like proxyquire, in the test environment that needs it. I can't figure a precise case, but I've got a persistent feeling that the suggested approach could backfire in some other situations.

Closing for now. Will open an updated PR if the need arises again and it really can't be addressed by more targeted solutions.

@rixo rixo closed this Jan 15, 2021
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.

svelte-loader resolves incorrect svelte when symlinked
2 participants