minify

VS2010 Automatically rebuild minified .js/.css files

為{幸葍}努か 提交于 2019-12-12 16:29:54
问题 Problem : I have been trying to integrate minification of javascript and css files in our VS2010 (.net 4.) projects. From what I hear, .net 4.5 and VS2012 will have minification build into the editor, so it will be as easy as setting a flag it will work. Unfortunately we are sill on VS2010 (.net 4.0). Let me explain what I want to do and what I dont want to do. I dont want to do big setups with classes/config file(s)/etc just to minify because all that stuff will have to be loaded on our

Google Closure compiler not compressing string values?

房东的猫 提交于 2019-12-12 15:16:05
问题 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 : (function(a,b,c,d){a.fn.demo=function(b){a(".bb-demo").addClass("active");a(".bb-demo").addClass("active");a(".bb-demo").addClass(

Auto minify Javascript/CSS files after update?

自闭症网瘾萝莉.ら 提交于 2019-12-12 10:53:49
问题 I know of ways to minify JS and CSS files but is there a way to auto-minify these files in the production system? For instance, I modify something inside the original JS files and update the production environment. However, while using the JS files, it should use an auto-minified version of the JS file (preferably update the current minified version if the source files changed). Considering that I work in both Unix and Windows environment, writing a bash script did not seem like a plausible

Use cache file or one more HTTP Request?

守給你的承諾、 提交于 2019-12-12 09:52:41
问题 on all the "speed up your website" sites and books they always tell us to minimize HTTP requests at all costs. This is fine and nice but what if that means that on every page you have to reload 120kb again and again and again because the user cache is empty? If i use 5 js files on every page of my website, wouldnt it be better to put them in one file and load this file on every page instead of putting them together with all other variable files in one big file and save one HTTP request. From

How do you build, bundle & minify ES6-modules?

和自甴很熟 提交于 2019-12-12 09:41:20
问题 Due the fact, that ES6-modules (JavaScript-modules) are available for testing: https://www.chromestatus.com/feature/5365692190687232 https://medium.com/dev-channel/es6-modules-in-chrome-canary-m60-ba588dfb8ab7 I wonder, how should I minify and prepare the project release-file? Earlier, I havde bundled all JavaScript-files into the single and minified file, except situations, where I have to load the JS-file dynamically via XHR or Fetch API. As I understand, it's rather impossible to prepare a

Are there any javascript minifiers that preserve line breaks?

佐手、 提交于 2019-12-12 09:37:19
问题 Error reporting from the client that always reports an error on line 1 (because the file is minified) is not very useful. I'd like to minify my code while preserving line breaks so that I get meaningful line numbers. Are there any javascript minifiers that have an option to preserve line breaks? 回答1: Take a look at closure compiler from Google with pretty print option enabled There are also plenty of options if you use the command line tool. 回答2: I've been looking for the same thing and

javascript minification that removes licenses?

自古美人都是妖i 提交于 2019-12-12 09:31:12
问题 Javascript minification will generally remove all comments from source. This means that license information is also removed. If I run a big site, and I want to abide by licenses, does that mean that I cannot use automatic minification? There is no option to "preserve the first comment, but not the others " right? I ask because a rather big company has used some code I wrote and not included my (MIT) license, but before I get all peeved, I want to put myself in their shoes. edit : It seems

How to get PHP to minify JS and CSS code? [closed]

吃可爱长大的小学妹 提交于 2019-12-12 08:17:55
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I'm looking for a PHP class that can minify JS and CSS code. 回答1: I never tested it, but this looks quite promising: Minify 回答2: I've found one over, in case anyone wants to take a look. Its called SmartOptimizer, and I think is pretty good! 来源: https://stackoverflow.com/questions/2212720/how-to-get-php-to

Why does Closure Compiler insist on adding more bytes?

白昼怎懂夜的黑 提交于 2019-12-12 07:40:08
问题 If I give Closure Compiler something like this: window.array = '0123456789'.split(''); It "compiles" it to this: window.array="0,1,2,3,4,5,6,7,8,9".split(","); Now as you can tell, that's bigger. Is there any reason why Closure Compiler is doing this? 回答1: I think this is what's going on, but I am by no means certain... The code that causes the insertion of commas is tryMinimizeStringArrayLiteral in PeepholeSubstituteAlternateSyntax.java. That method contains a list of characters that are

Minifying and inlining tool for less

↘锁芯ラ 提交于 2019-12-12 05:38:43
问题 I am looking for a tool to minify a website to one file. I found inliner but it also inclue my less client script and I would like my less to by compiled to css and be included. I want to inline javascript, stylsheet and images. Is there any tool I could use ? 回答1: A quick search led me to these options: Node-AMS - minify js (using uglifyjs), minify css (using cssmin from yahoo), inline small images in css using base64 data encoding, etc. Bundler - compiles, minifies and combines your