Skip to content

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