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(scan): detect import .ts as .js #8969

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Jul 7, 2022

Description

fix sveltejs/kit#5387

After detecting the loader type for a html-ish file, pass this info to the resolvePlugin so we can resolve .ts as .js


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@netlify
Copy link

netlify bot commented Jul 7, 2022

Deploy Preview for vite-docs-main canceled.

Name Link
🔨 Latest commit a402c6b
🔍 Latest deploy log https://app.netlify.com/sites/vite-docs-main/deploys/62c6c5742ea1970009ec7e3e

const resolved = await resolve(id, importer)
const resolved = await resolve(id, importer, {
custom: {
depScan: { loader: pluginData?.htmlType?.loader }
Copy link
Member

Choose a reason for hiding this comment

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

We already have a scan flag that is available also to the resolver. But I agree that using the convention for custom here feels better. So looks good to me 👍🏼

@patak-dev patak-dev merged commit 752af6c into vitejs:main Jul 7, 2022
@bluwy bluwy deleted the fix-scan-alias-js-ts branch July 7, 2022 11:51
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.

Can't build SvelteKit component libraries with "moduleResolution": "NodeNext"
2 participants