Skip to content

Add TypeScript + Webpack Configuration Tip #696

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

Merged
merged 1 commit into from
Nov 18, 2020

Conversation

dansalias
Copy link
Contributor

Description of Problem

.vue imports in <script lang="ts"> blocks aren't resolved by default by ts-loader. Attempting to do so will result in a [Vue warn]: Failed to resolve component: my-component console error.

Proposed Solution

Document the required configuration (using the appendTsSuffixTo ts-loader option).

Additional Information

Credit:

Resolving `.vue` component imports in `<script lang="ts">` blocks requires additional undocumented Webpack configuration.

Credit: https://lmiller1990.github.io/electic/posts/20200406_webpack_for_vue_3.html
Copy link
Member

@NataliaTepluhina NataliaTepluhina left a comment

Choose a reason for hiding this comment

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

@dansalias thank you for the contribution, much appreciated 👍🏻

@NataliaTepluhina NataliaTepluhina merged commit 80ddbb7 into vuejs:master Nov 18, 2020
nick-lai pushed a commit to nick-lai/docs-next that referenced this pull request Dec 2, 2020
Resolving `.vue` component imports in `<script lang="ts">` blocks requires additional undocumented Webpack configuration.

Credit: https://lmiller1990.github.io/electic/posts/20200406_webpack_for_vue_3.html
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