typescript 有没有办法将webpack捆绑的js文件转换成源代码ts?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45880191/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 04:50:30  来源:igfitidea点击:

Is there any way to convert webpack bundled js file into source code ts?

typescriptwebpack

提问by Nutan

Is there any way to convert webpack bundled js file into source code ts? I have bundle.js file with me bundled with webpack. Unfortunately the source code files are deleted by a stupid accident. I want to reverse engineer my bundle.js file to get back my source code typescript files. Is there any possible way to achieve this?

有没有办法将webpack捆绑的js文件转换成源代码ts?我将 bundle.js 文件与 webpack 捆绑在一起。不幸的是,源代码文件被一个愚蠢的意外删除了。我想对我的 bundle.js 文件进行逆向工程以取回我的源代码打字稿文件。有没有可能的方法来实现这一目标?

回答by Yakov Fain

Do you still have your source map files by any chance (e.g. main.bundle.js.map )? If so, you can run your app (ng serve), open the Chrome Dev Tools in your browser and you'll see your sources in TypeScript under the tab Sources -> webpack://

你是否仍然有你的源地图文件(例如 main.bundle.js.map )?如果是这样,您可以运行您的应用程序(ng serve),在浏览器中打开 Chrome Dev Tools,您将在 Sources -> webpack:// 选项卡下看到 TypeScript 中的源代码

enter image description here

在此处输入图片说明

回答by uruapanmexicansong

You may try using debundlenode module.

您可以尝试使用debundle节点模块。

Debundle

解绑