Questions tagged [minify]

Minification is the practice of removing unnecessary characters from code to reduce its size, thus improving load times.

A minifier is a tool to perform minification on set of text, most notably source code. In web development, page load times are important, so reducing the file size of JavaScript source files helps reduce the time it takes for the code to be downloaded over an Internet connection.

Minification is the practice of removing unnecessary characters from code to reduce its size. For developmental purposes, programmers use whitespace characters (spaces, tabs, carriage returns, etc.) to format source code in a way that is easier for humans to read.

The computers and software that consumes this code does not care at all about how it is formatted, so removing these characters will not alter the code's functionality at all.

Un-minified Example:

var myArray = [];
for (var i = 0; i < 20; i++) {
  myArray[i] = i;
}

Minified Example:

for(var a=[i=0];++i<20;a[i]=i);

Both of the examples perform the same task of iterating through 20 numbers and adding them to an array.

In addition to whitespace removal, minifiers will also rename variables to shorter names and possibly refactor some logic in ways that yield the same outcome.

2450 questions
1
vote
0 answers

Site Load Slow + why does Minify CSS take so long to download

Above is an image from Chrome Network that shows the site www.hot-girl.co (excuse the domain name - its only temp) downloading images. If you can see the image the minified CSS is only 20K (down from 100K) but it takes 5 seconds to download and I…
Adam
  • 19,932
  • 36
  • 124
  • 207
1
vote
1 answer

Minify JSON (or XML) in XCode build phase

I'm building an iOS app that frequently loads JSON configuration files at runtime. However, the files are very generous with comments and indenting. How can I tell XCode to copy minified versions of the files to the bundle during build?
philtre
  • 213
  • 1
  • 7
1
vote
1 answer

Typescript proper structure and compacting

I am trying to use typescript with modules as namespaces with the folder structure /ns1/ns2/class1.ts class2.ts usage.ts where usage.ts can do: new ns1.ns2.class1(); new ns1.ns2.class2(); If this were pure js I would do it all with…
maxfridbe
  • 5,872
  • 10
  • 58
  • 80
1
vote
1 answer

Minify Inline-JavaScript with PHP

Currently for my site, I'm able to minify JavaScript and CSS code through linked and But, to reduce HTTP requests, I have inline scripts and styles as well.…
Ricky Yoder
  • 561
  • 2
  • 11
  • 22
1
vote
1 answer

Does meteor minify the files in the client/compatibility directory in production?

From this link (http://docs.meteor.com/#structuringyourapp) the client/compatibility directory is the place to directly put client files that aren't smart packages in Meteor. However, does Meteor still minify the files in this directory in…
Andrew Mao
  • 35,740
  • 23
  • 143
  • 224
1
vote
1 answer

Regex minify
 tag content

I'm using this filter to minify my HTML. Unfortunately, that filter also minifies code inside
 tags, but I don't want them to be changed. How I can change the regexes so they don't minify any code inside 
 tags?
s = Regex.Replace(s, @"\s+",…
Jean Toledo
  • 71
  • 1
  • 7
1
vote
2 answers

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

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…
1
vote
1 answer

Speeding up FCKEditor

Does anyone have a technique for speeding up the FCKEditor? Are there some key JavaScript files that can be minified or removed?
craigmoliver
  • 6,499
  • 12
  • 49
  • 90
1
vote
1 answer

Structure web site for debug & production with minified JS using Google App Engine

I am using Eclipse J2EE with Google plugin for developing Java based web applications. I am also using GitHub private repository so that multiple developers can contribute to the development of the site. Inside my project directory I have the…
codefactor
  • 1,616
  • 2
  • 18
  • 41
1
vote
1 answer

uglifyJs Application needed(JavaScript Obfuscator)

I want to know if there is any version of uglifyJS in a windows application mode(not web based app) or maybe another good application that is not web based. This is the uglifyJS site. Thank you
bahar_Agi
  • 644
  • 4
  • 17
  • 29
1
vote
3 answers

Uglifying a RequireJS/Backbone project into one single .js file?

I worked along the following tutorial to try to optimize my project into one single .js file, but unfortunately I can't seem to get the expected results. I get r.js to create an optimized folder for me, but instead of a single file, I get uglified…
Alexandr Kurilin
  • 7,685
  • 6
  • 48
  • 76
1
vote
3 answers

Minifiable version of Prototype

Is there a version of the Prototype framework that is either packable or already packed at the highest compression level with Dean Edward's packer and is tested to work? Packer: http://dean.edwards.name/packer/ This is a Google-able question but I…
Kaze no Koe
  • 3,254
  • 1
  • 21
  • 22
1
vote
2 answers

Javascript error when minified

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…
Grim...
  • 16,518
  • 7
  • 45
  • 61
1
vote
1 answer

PyroCMS Minified Asset files across multiple machines

If I'm deploying a site across multiple servers (to be load balanced), it seems that on one of the servers, the minified assets aren't in assets/cache. It's there in the other ones, but not this one. Is that a database thing that PyroCMS uses to…
Shamoon
  • 41,293
  • 91
  • 306
  • 570
1
vote
1 answer

Referencing Minified Content in Asp.Net / MVC

We have dozens of scripts referenced in our web pages (MVC). To optimize the site if i minify and merge all scripts into one file , do i need to update those dozen references in each webpage with the new combined file ? If so is there a tool to…
Deb
  • 981
  • 13
  • 39
1 2 3
99
100