vuejs / vue-loader

📦 Webpack loader for Vue.js components
MIT License
4.99k stars 914 forks source link

<script setup lang="ts"> sourcemap does not display the sfc source correctly #2023

Open 1593292349 opened 1 year ago

1593292349 commented 1 year ago

Vue version

3.2.45

Link to minimal reproduction

https://github.com/1593292349/sfc-sourcemap.git

Steps to reproduce

  1. checkout master branch
  2. Installation dependency and run the command npm run build
  3. open the file dist/index.html
  4. look at the source panel for developer tools

What is expected?

I'd like to see the original sfc code. image

What is actually happening?

image

System Info

System:                                                        
    OS: Windows 10 10.0.19044                                    
    CPU: (24) x64 AMD Ryzen 9 5900X 12-Core Processor            
    Memory: 13.18 GB / 31.92 GB                                  
  Binaries:                                                      
    Node: 16.18.1 - C:\Program Files\nodejs\node.EXE             
    npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD                
  Browsers:                                                      
    Edge: Spartan (44.19041.1266.0), Chromium (108.0.1462.54)    
    Internet Explorer: 11.0.19041.1566                           
  npmPackages:                                                   
    vue: ^3.2.45 => 3.2.45

Any additional comments?

If I put the <script setup lang="ts"> Change to <script setup> You can see the original code

1593292349 commented 1 year ago

in vue3, <script setup lang="ts"> is wrong, <script setup> is right. in vue2,<script setup lang="ts"> has same problem with vue3, <script setup> is also wrong If you want to reproduce the vue2 problem, just switch to the branch of vue and repeat the same procedure