SoFunction
Updated on 2025-04-04

Solution to some map files appear after Vue package

Solutions to some map files appear after Vue package:

Question: Many people may be doing Vue project packaging. After packaging, some map files will be automatically generated in JS., so how can we remove them and not do it?

1. Run cnpm run build and start packaging

2. The dist directory will be automatically created in the project directory, and all the packaged files are included.

Solution: Change a parameter in src/config/:

productionSourceMap:false

Change this to false. Otherwise, some map files will appear in the final packaged file. The function of the map file is: after the project is packaged, the code is compressed and encrypted. If an error is reported at runtime, the output error message cannot be accurately known where the code reported an error.

With map, you can just like unencrypted code, and the exact output is what the row and column are wrong.

Finally, after you build, you will find that some map files are not automatically generated. . .

The above is all the content of this article. I hope it will be helpful to everyone's study and I hope everyone will support me more.