最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - What is the side effect of GENERATE_SOURCEMAP=false? - Stack Overflow

programmeradmin3浏览0评论

While using sv2pdf in a project, I faced a Failed to parse source map error. I found this solution and now it's resolved. The solution was to just add GENERATE_SOURCEMAP=false to the .env file.

However, I am not sure about the possible side effects of this solution. According to the official Create React App docs, it is ignored while in development yet used in production. Am I risking something by using this?

While using sv2pdf in a project, I faced a Failed to parse source map error. I found this solution and now it's resolved. The solution was to just add GENERATE_SOURCEMAP=false to the .env file.

However, I am not sure about the possible side effects of this solution. According to the official Create React App docs, it is ignored while in development yet used in production. Am I risking something by using this?

Share asked Aug 17, 2022 at 13:36 Yahya FatiYahya Fati 1933 silver badges14 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

A source map is a file that maps from the transformed source to the original source, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger. Mozilla

When the GENERATE_SOURCEMAP is enabled a full copy of your app's source code is bundled alongside the "minified" / "transpiled" version of JS files.

If you enable this (GENERATE_SOURCEMAP=true), the original source files will be visible to your app's visitors using tools like browser "Dev Tools".

And if you turn it off (GENERATE_SOURCEMAP=false), it won't create the source map files when you build your project (source maps are generated by default in production mode in CRA).

发布评论

评论列表(0)

  1. 暂无评论