minify

Obfuscate javascript properties?

妖精的绣舞 提交于 2019-12-09 12:30:13
问题 I've recently tested UglifyJS and YUI Compressor and noticed something odd. Both minifiers don't seem to change the names of object properties, only the names of variables and functions. for instance if I have the following code: var objName = {first:2, second:4}; alert(objName.first + " " + objName.second); the names first and second remain unchanged in the minified version. Why is that? 回答1: It's because it doesn't know where the object is going to be used. It could be used externally by

Minify inline javascript during build for ASP.net?

核能气质少年 提交于 2019-12-09 06:04:06
问题 We have a handful of ASP.net pages that include more than 50+ lines of javascript specific to that page. We'd like to minify that javascript during our CruiseControl build process. We already use the YUI Compressor to compress our full javascript and css files. But we can't figure out how to do the Inline javascript. Is there an MSBuild task to spin through asp.net pages and minify the javascript? 回答1: There is an interesting blog and NuGet package called undleMinifyInlineJsCss to handle this

Webpack not minifying my bundle js

久未见 提交于 2019-12-08 17:22:32
I'm now bundling my first project with webpack, everything works as expected except webpack is not minifying my bundle.min.js code. I'm pretty sure I'm doing something wrong, but can't spot the mistake. Any help would be appreciated. Thanks in advance. Here I go w/ my webpack.config.js var webpack = require("webpack"); var ExtractTextPlugin = require("extract-text-webpack-plugin"); var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); module.exports = { context: __dirname + "/public", entry: './app.js', output: { path: __dirname + '/dist', filename: "bundle.min.js" },

Proguard removing annotations in Android application

Deadly 提交于 2019-12-08 15:00:19
问题 I have included a project using gradle in my app: compile group: 'org.bytedeco', name: 'javacv', version: '0.11' Which builds fine. But whenever I run the app with proguard enabled, it apparently removes the @Platform annotation from the jars that get included then. I tried using the following based on http://proguard.sourceforge.net/manual/examples.html#annotations -keepattributes *Annotation* -keep @org.bytedeco.javacpp.annotation interface * { *; } I also tried the following based on http:

Could someone explain how I can combine my JS and CSS files?

╄→尐↘猪︶ㄣ 提交于 2019-12-08 06:44:42
问题 I have done my research on combining JS and CSS files. I am still a novice when it comes to all of this so the explanation like some of these minifies and compilers at Github and Google don't really make sense in normal English. I have the following CSS files: bootstrap bootstrap-min bootstrap-responsive bootstrap-responsive-min main prettyPhoto These are my JS files: bootstrap bootstrap.min jquery jquery.prettyPhoto jquery-migrate-1.2.1 theme Which tool should I use and if someone could

AJAX/JSON API minification?

耗尽温柔 提交于 2019-12-08 04:46:30
Many JSON / RESTful APIs have long and verbose key names that amount to most of the bytes making up the file. For example, from Twitter's REST API : "profile_sidebar_border_color": "DFDFDF", "profile_sidebar_fill_color": "F3F3F3", "profile_text_color": "333333", "profile_use_background_image": true, "default_profile": false, "default_profile_image": false, Doing this also requires that those names be used in the client files. For development this is nice, but for production it seems like it would be profitable to send the data with minified (single-letter) keys from the server, then re-inflate

Problems generating source map files with current Gulp setup

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 04:40:29
I have set up a gulpfile.js in my project. It's working pretty nicely mostly, except when it comes to generating source maps, especially for the LESS files it compiles to CSS . I have put together a gist which contains all the files in my gulp setup. Please note that other than the gulp file.js itself, all the other files are inside a directory called tasks . The problems I am having are that I had to disable the autoprefixer in development because the source maps that were being generated were invalid as the autoprefixer modified the original CSS file after the source maps were generated. To

How can I minify a Ruby source file?

房东的猫 提交于 2019-12-08 04:00:23
问题 I have a situation where I'd like to be able to minify (not compile) a Ruby script. The goals are to: Reduce the overall character count of the script; Perform a degree of obfuscation to make it difficult for others to modify the code. We can assume that: Yes, I know what I'm doing, and I really do want to minify and obfuscate the code. The source Ruby code has a simple syntax and doesn't use any advanced metaprogramming techniques or the like. Is there any existing library or tool for this?

Debugging minified JavaScript in Visual Studio with sourcemaps

狂风中的少年 提交于 2019-12-08 04:00:08
问题 We have an ASP.NET 3.5 (IIS Application Pool 2.0) webSite. We are developing it with Visual Studio 2013 update4 in Windows8.1 . The problem is that: When I minify JavaScript files (with Web Essentials extension) and change the aspx files to use the newly created min.js files, the debugger of Visual Studio or any other browser wont works correctly. We expected that we work on the original js file (put a breakpoint etc. . .), and web browser runs it's minified min.js file (since relations exist

Problems generating source map files with current Gulp setup

可紊 提交于 2019-12-08 03:28:06
问题 I have set up a gulpfile.js in my project. It's working pretty nicely mostly, except when it comes to generating source maps, especially for the LESS files it compiles to CSS . I have put together a gist which contains all the files in my gulp setup. Please note that other than the gulp file.js itself, all the other files are inside a directory called tasks . The problems I am having are that I had to disable the autoprefixer in development because the source maps that were being generated