Processing
 

How to minify angular.js?

07/09/2016 09:29#1

steven.j

Member

Joined at: 4 months ago

Post: 2

Thank: 0

Thanked: 0

There is a problem,i want to minify the angular.js, not my personal code but the angular library file --angular.js, I used gulp-uglify to minify it , here is the gulp code:

gulp.task('angularjsmin', function () { gulp.src(['lib/angular/angular.js'])      .pipe(uglify())     .pipe(contact("angular.min.js"))     .pipe(gulp.dest('dist/lib/angular')); 

});

It worked in morden browser , but it's unuse in IE8. The angular version is 1.2.29, it's support IE8, but the file "angular.min.js" which i minified is not support IE8, and when use it in IE8,the browser tell me that "Missing identify" and "angular is undefined". Is there any other methods to minify the angular.js? How can i solve this problem?Thanks for your help.

07/09/2016 11:29Top#2

GibboK

Member

Joined at: 9 months ago

Post: 11

Thank: 0

Thanked: 0

Use a CDN in order to delivery common libraries like angular or jquery, you will avoid possible headache of build it yourself. If you do not have a specific reasons and advantage to do so, a CDN is the good way to go.

Some major libraries are hosted on CDN for free on very reliable servers like Google offers:

https://developers.google.com/speed/libraries/

and you can simply include the library in your code as:

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>

The main advantage of a CDN is an increase in the speed on which the content is delivered to the users.

Some advantages are:

  • Lower server load.
  • Increase in concurrent users on server.
  • Geo-location.
  • User may have already downloaded the library (cached previously in browser).

But if you really want to build yourself try reading the following tutorial: https://docs.angularjs.org/misc/contribute

Similar articles

IE9 dosen't support my Button Tag

4 months ago - Reply: 0 - Views: 14

SSRS 2016 Web protal in IE8

4 months ago - Reply: 0 - Views: 13

how to handle @keyframes not supported by ie9?

4 months ago - Reply: 0 - Views: 5

Detect Windows XP in Firefox with JS

4 months ago - Reply: 1 - Views: 47

IE8 Not showing divs with floats

4 months ago - Reply: 2 - Views: 130

Including ECMA 5 script in IE8

4 months ago - Reply: 1 - Views: 98

XDomainRequest does not work in ie8 & ie9

4 months ago - Reply: 0 - Views: 10

How to minify angular.js?

4 months ago - Reply: 1 - Views: 30

VBA and IE8 - scrape text buried in table

5 months ago - Reply: 1 - Views: 37

Detect http satus IE10

5 months ago - Reply: 0 - Views: 6

how to compress angular.js?

5 months ago - Reply: 0 - Views: 3

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re