minify

AngularJS : minification issue in directive

让人想犯罪 __ 提交于 2020-01-20 17:09:13
问题 I have yet another issue with minification. This time it's because of the $scope service passed to the directive's controller. See below code: angular.module('person.directives'). directive("person", ['$dialog', function($dialog) { return { restrict: "E", templateUrl: "person/views/person.html", replace: true, scope: { myPerson: '=' }, controller: function ($scope) { $scope.test = 3; } } }]); If I comment out the controller part, then it works fine. As you can see, I've used the array

Packed/minified javascript failing in IE6 - how to debug?

怎甘沉沦 提交于 2020-01-17 05:35:19
问题 I have a number of files which I combine and pack to produce a single, minified JS file. The problem is that when I minify the file (using packer), IE6 gives one of its characteristic helpful error messages. Line: 12 // of course, line 12 is an empty line Char: 1 Error: Expected ')' Code: 0 The thing is: it works fine in IE7, Firefox and Chrome the problem only comes up for IE6. Unpacked, I have almost 200kb of scripts spread through 8 files. How on earth do I fix this? 回答1: Microsoft have

Bundle vs Minification,Which one is the best

只谈情不闲聊 提交于 2020-01-14 12:12:33
问题 I would like to know about which one of the following way is better. Bundle the css files and then use : bundles.Add(new StyleBundle("~/BootStrap/css").Include( "~/BootStrap/css/bootstrap.css", "~/BootStrap/css/bootstrap-responsive.css")); OR Use *.min file directly is as below : <link href="~/BootStrap/css/bootstrap.min.css" rel="stylesheet" /> <link href="~/BootStrap/css/bootstrap-responsive.min.css" rel="stylesheet" /> I would expect the explanation for performance wise and also as best

Bundle vs Minification,Which one is the best

我是研究僧i 提交于 2020-01-14 12:11:12
问题 I would like to know about which one of the following way is better. Bundle the css files and then use : bundles.Add(new StyleBundle("~/BootStrap/css").Include( "~/BootStrap/css/bootstrap.css", "~/BootStrap/css/bootstrap-responsive.css")); OR Use *.min file directly is as below : <link href="~/BootStrap/css/bootstrap.min.css" rel="stylesheet" /> <link href="~/BootStrap/css/bootstrap-responsive.min.css" rel="stylesheet" /> I would expect the explanation for performance wise and also as best

CSS and JS minification doesn't work with gulp-filter, gulp-csso, gulp-uglify

纵饮孤独 提交于 2020-01-13 20:31:12
问题 I'm working thorough johnpapa's course on automation with Gulp and seem to hit a weird wall: when I'm trying to run the CSS and JS concatenation and minification task it fails to do the minification. This is the task: gulp.task('optimize', ['inject'], function () { var assets = $.useref.assets({searchPath: ''}); var cssFilter = $.filter(['**/*.css'], {restore: true}); var jsFilter = $.filter(['**/*.js'], {restore: true}); return gulp .src(config.indexFile) .pipe($.rename('test.jsp')) .pipe($

Minifying code for PhoneGap App?

江枫思渺然 提交于 2020-01-12 02:31:17
问题 I am currently starting to build an PhoneGap application, I know the advantages of minifying code for browsers already. However, I was wondering if it was worth minifying my HTML, JavaScript and CSS code for my PhoneGap application? I would understand that the code run faster potentially faster? Also if that is the case is there an application that will do it all for me? (When I say do it for me I mean take a directory on my machine and minify the code saving a .min.js version? or is it a

Why does CoffeeScript wrap class definitions in a closure?

别说谁变了你拦得住时间么 提交于 2020-01-11 08:20:22
问题 In CoffeeScript, this: class Foo method: (x) -> x+1 Compiles to: // Generated By CoffeeScript Foo = (function() { function Foo() {} Foo.prototype.method = function(x) { return x+1; } return Foo; })() Which seems a bit excessive. The following should be functionally identical : // Generated by Dave function Foo() {} Foo.prototype.method = function(x) { return x+1; } What is the motivation for the extra "closure" wrapper? This is not merely an idle question of styling; it has implication to

Purifying css assets via laravel mix doesnt work

淺唱寂寞╮ 提交于 2020-01-06 05:08:05
问题 Description: Purifying option doesnt work while compiling css files.Can you explain what is wrong with this approach? Steps To Reproduce: This is inside my mix file: mix.style('resources/assets/css/some.css', 'public/css/some.css').options({ purifyCss: { paths: ['/home/smolen/Projects/laravel-test/resources/views/welcome.blade.php'], verbose:true, minimize:true, } }) This is my css file which stay the same after compiling: .unused-class{ color:red; } .used-class{ color:blue; } ``` This is in

Where is my Angularjs minify error? Error $injector

余生长醉 提交于 2020-01-04 14:00:03
问题 I'm running into that annoying Angular minify problem (I really hope this issue is non-existent in Angular 2) I've commented out all my app module injections and going down the list 1 by 1 to find out where the problem is and I think I narrowed it down to my searchPopoverDirectives : Can you see what I'm doing wrong? Original code, produces this error Unknown provider: eProvider <- e : (function() { "use strict"; var app = angular.module('searchPopoverDirectives', []) .directive(

Creating a script to use Google Closure for multiple javascript files

你离开我真会死。 提交于 2020-01-04 03:16:07
问题 I need to use the Google Closure compiler.jar to minify a huge project I am working on. I have multiple js files that I want to compile into a single game.min.js file. I know I can use the following: java -jar compiler.jar --js file1.js --js file2.js --js etc, etc --js_output_file game.min.js ...but I have a LOT of files and as I understand it Closure doesn't have support for adding a directory and finding all the *.js files residing under that directory. My fumbling google searches are not