Skip to content

Missed Source Maps for a component with a simple script block #2959

@AlttiRi

Description

@AlttiRi

Describe the bug

I have the start project.
With one change: I added build: { sourcemap: true } in the config.

After building it has missed source maps for App.vue file.
Here is:
2

While in dev it is showed:
1

App.vue file script block has just only an import:

<script setup>
import HelloWorld from './components/HelloWorld.vue'
</script>

If I will add, for example:

console.log(123);

It starts works as expected:
3
4

Reproduction

yarn create @vitejs/app my-vue-app --template vue

and use the follow config (in vite.config.js):

export default defineConfig({
  plugins: [vue()],
  build: {
    sourcemap: true
  }
})

System Info

Node: 15.9.0
@vitejs/plugin-vue: 1.2.1
vite: 2.1.5

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

  • Read the Contributing Guidelines.
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Provide a description in this issue that describes the bug.
  • Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions