简体   繁体   English

如何将多个 javascript 文件混淆成一个,并且仍然运行电子

[英]How to obfuscating multiple javascript files into one, and still run electron

Problem:问题:

How do I obfuscate multiple javascript files into one javascript file, where I still can run it with Nodejs Electron?如何将多个 javascript 文件混淆到一个 javascript 文件中,我仍然可以在其中使用 Nodejs Electron 运行它?

Thoughts:想法:

I know that you can obfuscate all javascript files in an Electron project and still run it, but is it possible to obfuscate all into one main.js?我知道您可以混淆 Electron 项目中的所有 javascript 文件并仍然运行它,但是是否可以将所有文件混淆到一个 main.js 中?

Running your JS in Electron or in a browser is irrelevant to the concatenation and/or obfuscation.在 Electron 或浏览器中运行 JS 与连接和/或混淆无关。 Same with Node.与节点相同。

You can always concatenate your JS project files(ie gather all your files in a single JS file).您始终可以连接您的 JS 项目文件(即将所有文件收集在一个 JS 文件中)。 You have plenty build engines for this task, the most popular today being webpack.您有很多用于此任务的构建引擎,当今最流行的是 webpack。

As for obfuscation, usually it is already good enough with minification when you allow mangling internal variables (which is the default setting of most minifiers).至于混淆,通常当您允许修改内部变量(这是大多数缩小器的默认设置)时,缩小已经足够好了。 The most popular today being Uglify, and you can easily combine it with build engines.当今最流行的是 Uglify,您可以轻松地将它与构建引擎结合起来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM