Home  >  Article  >  Web Front-end  >  Questions about Vue packaging map files

Questions about Vue packaging map files

亚连
亚连Original
2018-06-06 09:35:431831browse

This article mainly introduces the solution to some map files that appear after Vue is packaged. Now I will share it with you and give you a reference.

Solution to the problem of some map files appearing after Vue packaging:

Problem: Many people may be packaging vue projects. After packaging, some maps will be automatically generated in js file, how do we remove it?

1, run cnpm run build to start packaging

2, the dist directory will be automatically created in the project directory, and the packaged files will be in it

Solution : Go to src/config/index.js and change a parameter:

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 when running, the output error message cannot accurately determine where the code is reporting the error.

With map, you can accurately output which row and column are wrong, just like unencrypted code.

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

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

How to implement the WeChat code scanning payment function in the nodejs environment?

Using Vue to implement the underlying principles (detailed tutorial)

How to control file dragging and obtain dragging content functions in js

The above is the detailed content of Questions about Vue packaging map files. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn