FAQ Database Discussion Community


CodeIgniter and Minify Index.php clash

php,apache,codeigniter,mod-rewrite,minify
I am using CodeIgniter which has an htaccess file in the root directory: Options -Indexes RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [L,QSA] Minify library folder is also placed in the root directory: <IfModule mod_rewrite.c> RewriteEngine on # You may need RewriteBase on some servers #RewriteBase...

Closure compiler export Typescript classes and functions

javascript,typescript,minify,google-closure-compiler,bundling-and-minification
I am trying to use closure compiler advanced mode on typescript generated classes with no success. Is there anyone who has accomplished such things. Typescript Class class TestData { BlogName: string; CacheTimeOut: number; CopyrightHolder: string; constructor(blogName: string, cacheTimeOut: number, copyrightHolder: string) { this.BlogName = blogName; this.CacheTimeOut = cacheTimeOut; this.CopyrightHolder =...

How do front end devs bundle and minify files?

javascript,css,minify
What's the best practice for minifying and bundling js/css in a pure front end app, and how do the tools work? I know how this can be done with server side apps like .NET/Java/LAMP/etc. But what about pure front end projects, SPA projects or backendless projects that are built with...

http2; Is minifying JS, Concatenate JS/CSS and using sprites no longer needed? [closed]

javascript,css,minify,http2
With the new http2 protocol the issue of creating many request for one page seems to have been solved. So, is there still a (significant) speed improvement when you minify and concatenate javascript/CSS files, and are Sprites no longer useful to speed things up? Do these three techniques still have...

Golang: bytes.Buffer max buffer exceeded

go,minify
I'm trying to use minify library to bundle and minify all my JavaScripts and CSSs, minimum code: js := bytes.Buffer{} dat, err := ioutil.ReadFile(fname) if L.Check(err, `File doesn't exists: `+fname) == nil { dat, err = min.MinifyBytes(`text/js`, dat) js.Write(dat) js.WriteRune(';') } But that code failed with err="max buffer exceeded" when...

Unknown Source when I use Proguard

android,proguard,minify,shrinkresources
My crash report is a little bit useless if I use Proguard (minifyEnabled true and shrinkResources true) This is the report with Proguard: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ProgressBar.setVisibility(int)' on a null object reference at xx.xxxx.xxx.xxxxx.xxxxxx.restoreViewAfterLoading(Unknown Source) at xx.xxxx.xxx.xxxxx.xxxxxx.newInstance(Unknown Source) onCreateView onViewCreated access$000 at xx.xxxx.xxx.xxxxx.xxxxxx$1.success(Unknown Source) at xx.xxxx.xxx.xxxxx.xxxxxx$1.success(Unknown...

PhpStorm: open source JS file instead of min file when Ctrl+Clicking

phpstorm,minify,file-watcher
I just started using File Watchers on PhpStorm to minify all my JavaScript in the project, and I've linked my docs already to the minified versions of the JS. The problem I'm having now is I lost the ability to JUMP to the JS source code (function/method) directly by control...

Visual Studio MVC and WebStorm working together and minimizing assets

angularjs,visual-studio-2013,single-page-application,minify,webstorm
I'm developing a SPA application in VS. I have separated html (angularjs) and webapi services. I develop html pages and css in WebStorm (which is perfect for the job) and VS for webapi (WebStorm and VS project folders are the same). Everything works fine but I want to minimize html...

Concatenating Bootstrap, jQuery and local JavaScript - breaks jQuery

javascript,jquery,css,twitter-bootstrap,minify
Currently I minify and concatenate my JavaScript and CSS files for my local 'theme'. Then I load the Bootstrap, jQuery and my local JavaScript/css files in the head of my website. Whilst this works, it does result in 8 separate resource loads, rather than just 2 (1 for JS, 1...

Grunt hangs on uglify

node.js,gruntjs,minify,grunt-contrib-uglify
I am trying to minify a little angular script, but for some reason uglify just hangs indefinitely. JSHint runs fine and completes if I add it into the task list, and then it hangs on uglify. Here is my Gruntfile: module.exports = function (grunt) { // Project configuration grunt.initConfig({ //...

How to rename Request/Response object properties in ASP.Net MVC Web API?

rest,asp.net-web-api,minify
Could you help me please to minimize response of my Web API Route. public class Product { public string UniqueId {get;set;} public string Title {get;set;} ... } public class ProductsController : ApiController { public IEnumerable<Product> GetAllProducts() { return repository.GetAll(); } // .... } The response contains full names of the...

ui-router annotating resolve with parameters for minifying?

angularjs,angular-ui-router,minify
ui-router breaks when minifying if the code isn't annotated properly. I have done this and most of my routes work, but this in particular does not: var authRedirect = function(s) { return ['$state', '$q', 'AuthService', function($state, $q, AuthService) { var d = $q.defer(); var is_auth = AuthService.checkAuth(); if(!is_auth) { d.reject();...

How can I align all source code to the left?

php,html,wordpress,compression,minify
Viewing the source code of my WordPress-powered website looks something like this: Is there a way to clean that up a bit so the code looks more like this: Where everything is left aligned and empty lines are stripped out. I know I could modify my theme's php files and...

Combine js files from different directories via config using grunt

javascript,gruntjs,npm,minify
I'm using grunt and sass and I'm looking for a sass-like feature to import any JS file I like to and combine them to 1 file via some config depending on the directory I am in. Example directories: startpage file1.js file2.js importjs.json page1 file3.js file4.js importjs.json global global1.js global2.js Each...

How to uglify or minify C code [closed]

c,gcc,minify
Using gcc I can remove comments and unwanted blank lines, but I want to reduce a size of file also, is there any options in gcc or any other tool to do so At present I do like this gcc -fpreprocessed -dD -E -P source_code.c > source_code_comments_removed.c Here is scenario...

Proguard removing annotations in Android application

java,android,proguard,minify,javacv
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...

Prevent circumventing ASP.NET minification

javascript,asp.net,asp.net-mvc,minify,bundling-and-minification
I've got some ASP.NET that I'm deploying as an Azure cloud service. The javascript files have comments in them that I'd like not to be visible to anyone consuming the JS. I'm taking advantage of ASP.NET bundling and minification: http://www.asp.net/mvc/overview/performance/bundling-and-minification This seems to be a nice solution in that it...

Why does my node application sends tons of get requests?

node.js,optimization,minify,mean-stack
Whenever I refresh a page in my MEAN application, my terminal that's running the application outputs tons of get requests. Is this slowing down my app? Can I get rid of some of these? GET / 304 113.645 ms - - GET /assets/stylesheets/css/bootstrap.min.css 304 11.846 ms - - GET /assets/stylesheets/css/animate.css...

JS Script Broke After Minification

javascript,json,minify
After Minification my Jquery Stops Working and Gives Error JSON.parse: unexpected character at line 1 column 1 of the JSON data If I Remove Minification My Scrips Works Fine.....

css minifier to merge selectors with same properties

css,compression,minify
I've been using Adobe Reflow to generate layouts. but to my horror, i found that it creates a separate selector for identical elements too, and each of these selectors have their properties defined separately. This has resulted in enormous file sizes for small documents. I cannot manually merge these selectors...

Can bracket notation be used to compress/obfuscate JavaScript?

javascript,performance,compression,minify,uglifyjs2
This is mainly for academic reasons, but I'm curious as to whether there is anything wrong with extensively using bracket notation over dot notation. Some possible applications may include: further compression by deduplication of commonly used methods or properties further obfuscation by making de-minified code still hard to understand/follow I...

Is it possible to remove code comments with Git

git,minify
Might go against some git best practise, but it possible to remove code comments or minify code with a git command. Something like git pull --minify.

How to manually minify a JavascriptResult content before returning it

asp.net-mvc,minify
I have a controller that has a special method to return me a js content uppon some requests params. Everything is working greatly, I'm simply using a method that returns a JavaScriptResult and I'm rendering a view (that has the whole js content) to a string and returning it. Now...

Load resources via CDN or minifiy/concat and serve yourself? [on hold]

javascript,css,minify,bundling-and-minification
When serving static css/js/etc resources one has the option to use a cdn or to use your own server. With a CDN you include many includes but they can already be minified. Alternatively you may minify and concatenate all the files into one css bundle and one js bundle. Which...

Minify code for same divs for same effect

javascript,jquery,html,css,minify
i have the following jquery code: $('#menu1').click(function(e){ $('#menu1').addClass('fullscreen'); if($('#menu1').hasClass('fullscreen')){ $('.barra').removeClass('hidden'); } }); $('#close').click(function(e){ $('#menu1').removeClass('fullscreen').animate({ width: '200px', height: '200px' }, 2500); }); HTML <section> <div class="content"> <div id="menu1"> <div class="blackbar hidden"> <a href="" id="close" title="Close"><img src="img/cross.png" width="40" height="40" alt="fechar"/></a>...

uglifyjs javascript inside php files

javascript,php,minify,uglifyjs
My project has a lot of JS code inside PHP files. I want to minify the JS code in these files and I like the uglifyjs2 program. Is it possible for that (or any) JS minifier to act on JS code INSIDE a php file? Someone is going to suggest...

Why we use minified version of Angularjs (Reason to give preference to angular.min.js over angular.js even if we are adding angular.min.js.map) [duplicate]

javascript,angularjs,minify,source-maps
This question already has an answer here: angular.min.js.map not found, what is it exactly? 2 answers I added angular.min.js to my project and faced this issue. http://localhost:8000/AngularProject/angular.min.js.map 404 (Not Found) angular.min.js.map:1 Upon research, I found that adding angular.min.js.map got rid of the "404 (Not Found)" error. I also found...

Compile multiple js files into one minified file using IntelliJ IDEA 14

javascript,intellij-idea,compilation,minify,transpiler
I have a directory structure that looks like this: ├── index.html ├── scripts │   ├── accordion │   │   └── accordion.js │   └── console │   └── test.js I want accordion.js and test.js to compile to a single minified file scripts/site.js. I've done this before with gulp but I'm trying to use...

Is my minified javascript conflicting with my AWeber javascript?

javascript,wordpress,cdn,minify,cloudflare
I’ve got a page with an AWeber popup form that’s intended to be made visible by clicking a “Get Music” button. You can see it here: http://www.radionowhere.net This was working fine until I set up Cloudflare as a CDN for my site and started using it to minify my CSS...

Dynamic image ng-src doesn't change to minified image name

angularjs,gruntjs,minify,grunt-usemin,grunt-contrib-imagemin
I've got two images, a green check mark and a grey check mark. These are shown/hidden as the user checks or unchecks an item in a list. The problem I'm having is that when minifying the app's images with grunt-contrib-imagemin, these two images ng-src doesn't change to the minified image...

How to make this css readable?

css,minify
I want to edit this CSS file but as you see, it does not look like a normal CSS style....

What is the default for minifyEnabled for buildType not explicitly scripted?

android-studio,gradle,android-gradle,proguard,minify
I imported several eclipse projects to Android Studio (v1.1). In the original Eclipse environment, they use Proguard for release mode. In the Android Studio environment, this was translated to the following in the build.gradle script (by the import, not by me): buildTypes { release { minifyEnabled true proguardFiles 'proguard.cfg' }...

GulpJS Task automatically minify when file changes

javascript,gulp,minify
I need to minify automatically all files when some change occurs in my js or less files. I have some Tasks for Minify my less files and js files called 'styles','services' and 'controlles'. For minify this files i just execute this task and everything forks fine: gulp.task('minify', ['styles', 'services','controllers']); Instead...

How to use bundle transformer to Minify CSS or JS

c#,asp.net,minify
I want to use bundle transformer to bundle and minify my css collection , but however i tried it doesn't work heres my code, please give me some advise, thanks. var nullBuilder = new NullBuilder(); var cssTransformer = new StyleTransformer(new CleanCssMinifier()); var nullOrderer = new NullOrderer(); BundleResolver.Current = new CustomBundleResolver();...

Google Closure compiler not compressing string values?

javascript,compression,minify,google-closure-compiler,yui-compressor
Having something like this: (function ($, window, document, undefined) { 'use strict'; $.fn.demo = function (options) { var active = "active"; var section = ".bb-demo"; $(section).addClass(active); $(section).addClass(active); $(section).addClass(active); $(section).addClass(active); }; })(jQuery, window, document); Closure Simple mode results in 200 bytes:...

ENOTUP using Grunt

javascript,node.js,gruntjs,minify,grunt-contrib-concat
I'm using Grunt to minify and concatenate files for an AngularJS web application. Our source is on a file share and I'm connecting to it via a mapped drive. Whenever Grunt runs over my source directory, I get an error on one of my concat tasks. The error is "ENOTSUP,...

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

javascript,obfuscation,minify
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 =...

Why would both regular and minified Bootstrap CSS be referenced in code?

html,css,twitter-bootstrap,minify,bundling-and-minification
I am trying to implement a third-party script which references the following in its demo template: <link href="/css/bootstrap-image-gallery.min.css" rel="stylesheet"> <link href="/css/bootstrap-responsive.min.css" rel="stylesheet"> <link href="/css/bootstrap.css" rel="stylesheet"> <link href="/css/bootstrap.min.css" rel="stylesheet"> <link href="/css/jquery.fileupload-ui.min.css" rel="stylesheet"> <link href="/css/prettify.css" rel="stylesheet"> <script type="text/javascript"...

Using the google closure compiler Java API

java,maven,minify,google-closure-compiler
I would liket to use the Google Closure-Compiler from Java. I download the compiler from the Maven repository (com.google.javascript.jscomp) but I can't find any documentation on how to use it. I don't want to use command line interface. Is this still type of usage still supported?...

Concatenate and minify CSS for production [closed]

html5,css3,minify
What does it mean by "concatenate and minify for production"? I know about minifying CSS. I personally use CSSMinifier.com to input my CSS file and then replace my content with the output it has generated for me. I do not know what it means to concatenating and then minify. Is...

Javascript unusual FOR loop. Please, confirm that my interpretation is correct

javascript,syntax,minify
I have a piece of code in javascript: for ( m = a[1], s = a[2], c.hash_match = i.replace(m, ""), o.lastIndex = 0; a = o.exec(s); ) { e[a[1]] && (c[e[a[1]]] = c[e[a[1]]] || decodeURIComponent(a[2])); } And how i think is works: m = a[1]; s = a[2]; c.hash_match =...

How to add a timestamp comment to my output files?

javascript,less,concatenation,gulp,minify
I have Gulp setup to convert my LESS files to CSS, concatenate them and minify them. Same for my JS. I'd like to have a small comment at the start of each minified CSS/JS output file that contains the time the file was built. Something that will allow me to...

How can I minify my index.php using grunt?

php,html,optimization,gruntjs,minify
I want to achieve this using grunt Goal My main goal is to minify my index.php before placing them on my production server. It's simple if I have 1 single index.html, but I don't. Instead I have an index.php full with other .php files. Each <?php ?> section is...

Underscore JS source – How is this saving bytes?

javascript,underscore.js,minify
While reading through the commented underscore source code, I encountered this line at the beginning: Save bytes in the minified (but not gzipped) version: var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; What exactly is done here – saving bytes by avoiding line breaks? To me this seems...