![]() Probably TMI but you might find it useful. The result is a significant size reduction in requested assets (such as CSS, images, and JavaScript files). NET and there might be similar solutions that are more. Things might have moved on since I worked with. What is JavaScript obfuscation, and how does it work What are the obfuscation techniques and metrics in JavaScript What is an example of JavaScript obfuscation Why isn't JS obfuscation frequently not enough to cover some use cases Familiarity with JavaScript and npm is a plus, but not necessary to dive into this guide. This is all for a bunch of Node.js apps but there is no reason the same strategy wouldn't make sense for. The dev server for the apps looks at the local build directory of that project for its assets. When running that project locally in using Webpack with the -watch flag so all changes get built straight away. In this article, we will learn how to bundle and minify files with Visual Studio. Webpack and NPM are amazing for this Makes it easier to work with Typescript (and Babel which we've had to do because we are building a bunch of Material Design web components and the type definitions for MDC are not keeping up to date with that framework fast enough). The result is then written to disk for fast reference in the future. Hence, we have to use either Gulp scripts or the open-source WebOptimizer. In ASP.NET Core, we do not have BundleConfig. Other solutions include tools like Gulp to minify Javascript and CSS files. In a separate thread (so the original request returns without delay) we then merged the included files together (1 for JS, 1 for CSS), and then apply the Yui compressor. In ASP.NET MVC, we could use BundleConfig to bundle and optimize Javascript files. It also means we can quickly roll back if there has been a mistake by simply changing the version numbers in this configs. The first time a request is made for a page, we process through the list of included JS and CSS files. Upon upload, configuration files on the live sites are updated so that our layout pages know what version of JS and CSS to load. ![]() ![]() I use version numbers so we can cache the hell out of them and not have to worry about old versions being loaded when new versions are up. Minifying JS is about loading speed and obfuscating JS is for making it harder for other developers to read your code. This is all done by Travis CI on git push to our release branch. ![]() These are then uglified, gzipped, and output with a version number in their file names before being uploaded to the CDN we use. I've got all our CSS and JS code in a separate Git repo and use NPM with Webpack to bundle everything into 2 artefacts (this includes all dependencies). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |