minify

Minify index.php

余生长醉 提交于 2019-12-11 09:04:26
问题 Situation I'm struggling trying to minify my index.php file I've tried Here is what's in my : index.php <?php include 'master.php'; ?> <?php function htmlmin($buffer) { $search = array( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' ); $replace = array('>','<','\\1'); if (preg_match("/\<html/i",$buffer) == 1 && preg_match("/\<\/html\>/i", $buffer) == 1) { $buffer = preg_replace($search, $replace, $buffer); } return $buffer; } ob_start("htmlmin"); ?> When I do view page source , I still see my

Javascript error when minified

十年热恋 提交于 2019-12-11 08:57:30
问题 I'm minifying Javascript in production with jsMin.php https://github.com/rgrove/jsmin-php/ Here is the unminified JS code: function arc(r, p, a) { return "A" + r + "," + r + " 0 " + +(a > Math.PI) + ",1 " + p; } and the minified code: function arc(r,p,a){return"A"+r+","+r+" 0 "++(a>Math.PI)+",1 "+p;} When minified, the code throws an 'unexpected identifier' error. If I take the + sign before (a > Math.PI) away, it works okay. I guess my question has two parts - why is this an error when it's

Grunt: minify js across project of multiple dirs, so that the contents of each dir flattens to a single minified file

一世执手 提交于 2019-12-11 07:43:56
问题 I have a project, with javascript files structured something like this: My goal: I would like to minify/uglify these javascript files in the build output, such as there is 1 minified file per each directory . So for example, if I'm storing the js in my build output in bld/js, then in bld/js, I would end up with files: dir1.min.js (result of concatenating and minifying fileA.js, fileB.js, and all the other js files in /src/js/dir1/), dir2.min.js (result of concatenating and minifying fileG.js

'DBCPConnectionPool' Service Not accepting values stored in attributes

十年热恋 提交于 2019-12-11 04:56:58
问题 Following are the combination of processors that I am using:- GetFile + SplitText + ExtractText + UpdateAttribute + ExecuteSQL + ConvertAvroToJson + PutFile Basically,I have a properties file which contains 5 comma separated values that are required by the 'DBCPConnectionPool' controller service to establish connection with the database. Here is the content of my properties file:- jdbc:mysql://localhost:3306/test,com.mysql.jdbc.Driver,C:\Program Files\MySQL\mysql-connector.jar,root,root Now,

grunt task to determine files needed by web app

时光毁灭记忆、已成空白 提交于 2019-12-11 03:53:58
问题 i'am a newbie and started to build a webapp with yeomans webapp generator and a static html 5 template. The template is able to use over 40 plugins. The template directoy structure is like: index.html --assets --css --js --img --plugins --bootstrap --cs --fonts --js ... ... My project only uses a quite little part of it. Is it possible to determine which files are used(referenced) within the project, and copy them automatically with a grunt task to the .tmp and .dist folder? Currently i used

Stop Cassette from minifying a JavaScript file

无人久伴 提交于 2019-12-11 03:33:11
问题 I'm using Cassette to minify my JavaScript. I don't want Cassette to minify one of my JavaScript files because it's causing an error. I'd rather use the already minified version provided by the original library authors. How can I add a JavaScript file to Cassette without it minifying the file? 回答1: You can use the following code for Cassette 1.x to create a IAssetTransformer that doesn't perform any minification public class NoMinification : IAssetTransformer { public NoMinification() {}

Draw.io : How can I debug unminified js code?

ε祈祈猫儿з 提交于 2019-12-11 02:09:15
问题 I downloaded draw.io source files from the github repository and tried to make some minor changes to the import function, but all the sources are minified (especially app.min.js). So my question is this: is there any way to debug the code with the unminified sources? Also I tried to pass inside the query string the param dev=1, but it gives some errors and doesn't manage to load. I already saw the post Draw.io — Is there non-minified source? but I don't know how to build draw.io. 回答1: If you

Can't minify with Combres and yui

怎甘沉沦 提交于 2019-12-11 00:44:00
问题 I am not sure how to find out more about whats wrong with my .js file, but if I turn "defaultDebugEnaled = true" then it works fine, but putting it to false makes me get this error And I can't seem to toggle anything to make it give me a more specific error, I only know that it fails when trying to minify it. Also this only happens when I include one certain file, but this is work so can't just post that file. Server Error in '/' Application. [ERROR] missing formal parameter Description: An

Is me = this in JavaScript a good practice to support minification?

无人久伴 提交于 2019-12-10 22:34:06
问题 So in my JavaScript codebase I have been using the var me = this idiom to support minification. But I've started questioning this lately, and I was wonder if assignment of this to a variable could be avoided with smarter minification tools? It seems like a tool should be able to detect functions where creating a variable to represent this would save characters over multiple calls to this . The same could be done for boolean values, like var yes = true, nope = false . Are there tools I could

AngularJS: minifications breaks my directive

拈花ヽ惹草 提交于 2019-12-10 20:26:22
问题 I use a directive to ask user for action confirmations in modals. It works like a charm during development, but, after minification, it's broken. This is the dreadful " $injector: unpr " error I get: Error: [$injector:unpr] Unknown provider: aProvider <- a ... I presume the problem is that $scope and $modalInstance are renamed, and should not be, but I don't know how to avoid this... This is the directive code: 'use strict'; app.directive('reallyClick', ['$modal', function($modal) { var