![]() The code is easily readable by someone that understands JavaScript, we do have a user object that is scoped within a function and there's a public object with methods in the window. So, if the code is readable as well, this person could steal your work and modify it at its will.Ĭonsider the following example of JavaScript ( example.js). (You can use tools to proceed minify, e.g: html-minify for html) You can use gzip to compress statics assets using your favorite server such as nginx, node, or apache. For example, optimization.minimize can be set with -optimization-minimize, and mode can be set with -mode. ![]() CLI Alternatives Many of the options described above can be set as command line arguments. Please see the Minimizing for Production section. So if the JavaScript code works without server interaction, someone could just download the HTML of your page, the resources (JS and CSS) and will obtain the same result locally. The first solution is to minify your assets as html, css, javascript, images. Minimize CSS It is crucial to minimize your CSS for production. Minification is the process of removing unnecessary data present in code resulting in smaller file sizes. This adds a level of security to source code specially in web world were source code is readily available. Obfuscation is the process of making your code unclear and unreadable to humans. This way, both benign and malicious JavaScript use code transformations. Writing simple obfuscation and minification system. So if that person understands JavaScript, your source code is public now. With the term obfuscation, we refer to techniques, which aim at hindering code analysis. But, in obfuscation, the files are modified to deliberately make them. Serving a JavaScript file without obfuscation, simply means that the code in the file will be readable by anyone. When you have multiple JavaScript files in node.js (CommonJS) format, you can combine them to create a single bundle of JavaScript. Obfuscation in Javascript is also a process in which Javascript files are modified.
0 Comments
Leave a Reply. |