minify

CSS bundle minification replacing Unicode characters

蓝咒 提交于 2019-12-13 14:26:52
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 6 years ago . I'm seeing an issue in VS2012 that replaces the Unicode characters in my minified CSS code. font-family: "FontAwesome"; content: "\f002"; This is fine in the un-minified bundle css file that is created, however, the \f002 is being replaced in the minified bundle css file. font-family:"FontAwesome";content:""; Is there some kind of escape I can use to stop

Javascript comma syntax, and complex expressions, minified, obfuscated: please help me understand a piece of code

半城伤御伤魂 提交于 2019-12-13 07:03:15
问题 I need to understand some pieces of code. I feel fine with the syntax of Java, C++, PHP, but Javascript syntax is still a "dark forest" for me. Here are the original forms and possible interpretations, I mean equivalents in terms of program logic: 1. var o, a, s = "https://widget.kiwitaxi.com", c = e.createElement("iframe"), l = e.getElementById(r.target), p = r && r.height_bias ? 4 + r.height_bias : 4, u = !1, f = parseInt(r.min_height, 10) ? parseInt(r.min_height, 10) : r.hide_form_extras &

TypeScript/JavaScript minification

时光总嘲笑我的痴心妄想 提交于 2019-12-13 06:00:53
问题 I have a web application written in TypeScript and at some point, all the output of the compiled .ts files will be minified. Now, at some point in my code I do something like this: class Test { testProperty: any; constructor() { this.getMethods(); } private getMethods(){ for (var method in this) { if (method.endsWith("Method")) { alert(method); } } } doSomethingMethod(){} } var x = new Test(); While I haven't done any test myself, but from what I've read (this blog post, the first comment of

Setting Visual Studio to automatically minifying using Ajax Minifier

拈花ヽ惹草 提交于 2019-12-13 05:20:26
问题 I use VS 2010 I would like at the pressing of Build Button have all CSS and .JS files minified. Following this article all is working great for JS... adding some extra code for the CSS (pasted below) I'm not able to Minifying the CSS. What I'm doing wrong here? Thanks for your time. <Import Project="$(MSBuildExtensionsPath)\Microsoft\MicrosoftAjax\ajaxmin.tasks" /> <Target Name="AfterBuild"> <ItemGroup> <JS Include="**\*.js" Exclude="**\*.min.js;Scripts\*.js" /> <JS Include="**\*.css" Exclude

Debugging JavaScript minification errors (in Liferay 6.2)

可紊 提交于 2019-12-13 04:34:21
问题 Liferay 6.2. tries to use best practices and JS minification is one of them. But what do you do when your unminified JavaScript works and minification produces errors like this (in Tomcat console): 12:23:48,794 ERROR [http-bio-8080-exec-10][MinifierUtil:111] 607: 21: identifier is a reserved word 12:23:48,797 ERROR [http-bio-8080-exec-10][MinifierUtil:111] 608: 45: identifier is a reserved word 12:23:48,802 ERROR [http-bio-8080-exec-10][MinifierUtil:111] 1: 0: Compilation produced 2 syntax

Function with eval won't make it through minification

…衆ロ難τιáo~ 提交于 2019-12-13 04:32:58
问题 Here is my weird function that let my users create their own javascript code function evalThisFunction(functionBody){ var func; eval("func = " + functionBody); return func; } But after minification with Closure Compiler (http://closure-compiler.appspot.com/), I get this result : function a(b){eval("func = "+b);} Do you see a way I can modify my weird function so it will still works after minification? 回答1: Yes, use the Function constructor: function evalThisFunction(functionBody){ return

How to minify php html output without removing non empty newlines?

末鹿安然 提交于 2019-12-13 04:25:49
问题 How to minify my php page html output like google page speed does? Example: <!DOCTYPE html> <html> <head> <title>Untitled Document</title> <meta name="description" content="Phasellus rhoncus euismod libero a lacinia. Lorem ipsum dolor sit amet, consectetur adipiscing elit." /> </head> <body> <div id="content"> <div id="post-1"> <h1>Phasellus rhoncus euismod libero a lacinia.</h1> <p>...</p> </div> <div id="post-2"> <h1>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h1> <p>...</p> <

JQuery Slider for Mobile application

筅森魡賤 提交于 2019-12-13 01:33:24
问题 I would like to use the JQuery slider for my mobile application http://docs.jquery.com/UI/Slider However, using the Slider plugin, requires me to use the entire JQuery core (29kb) + Slider plugin (6kb). Typically, that's okay but for a mobile application - that's a lot of data. Question : Anyway I can use the JQuery Slider and eliminate any bloat that might exist in the core? I would really like to reduce this 29kb core down to something much smaller. (e.g. just using Sizzle + plugin or

GulpUglifyError: unable to minify JavaScript (Angular 4)

谁都会走 提交于 2019-12-12 21:53:11
问题 I have a problem with uglify main bundle.js file. This is my gulp scripts: gulp.task("compile", () => { let tsResult = gulp.src("app/**/*.ts") .pipe(sourcemaps.init()) .pipe(tsProject()); return tsResult.js .pipe(sourcemaps.write(".", { sourceRoot: '/app' })) .pipe(concat('bundle.js')) .pipe(gulp.dest('app/_Dist/')); }); gulp.task("minify", ["compile"], function () { return gulp.src(['app/_Dist/bundle.js']) .pipe(concat('bundle.min.js')) .pipe(plumber()) .pipe(uglify()) .on('error', function

VS MVC Project CSS Minification fails when using CSS variables

南楼画角 提交于 2019-12-12 20:53:38
问题 In Visual Studio, Minification is failing for me in my MVC project when I introduce any variables in my bundled css files. Example: /* Minification failed. Returning unminified contents. (3,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-' (6,23): run-time error CSS1039: Token not allowed after unary operator: '-main-bg-color' */ :root { /*DEFAULT COLORS LINES*/ --main-bg-color: rgb(34,34,34); } body{ background-color:var(--main-bg-color); } other minifiers work