Skip to content

Conversation

@matthewp
Copy link
Contributor

Description

This updates the import scanner to treat <script> tags inside of .astro files as TypeScript and not JS. In Astro plain scripts can contain TypeScript and this changes prevents error messages coming from the import scanner.

Additional context


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.

This updates the import scanner to treat `<script>` tags inside of `.astro` files as TypeScript and not JS. In Astro plain scripts can contain TypeScript and this changes prevents error messages coming from the import scanner.
@matthewp
Copy link
Contributor Author

Looks like I broke all the things, will fix 😀

@matthewp
Copy link
Contributor Author

@patak-dev Tests are fixed

@patak-dev patak-dev added the p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) label May 12, 2022
@patak-dev
Copy link
Member

I don't think this is a good long-term solution. We need to find a way to let frameworks configure Vite instead of adding patches in Core. But I still think we should merge this PR while we define and implement this API.

@antfu antfu changed the title feat: Treat Astro file scripts as TS feat: treat Astro file scripts as TS May 13, 2022
@patak-dev patak-dev merged commit 559c952 into vitejs:main May 13, 2022
@matthewp matthewp deleted the treat-astro-as-ts branch May 13, 2022 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants