How can I reduce the size of an Angularjs site using Google Closure Compiler? I have a site on Angularjs 1.8. x, but I want to compile it using Closure. How can this be done? If there are ready-made examples and demos?
'use strict';
// Declare app level module which depends on views, and core components
angular.module('myApp', [
'ngRoute',
'myApp.view1',
'myApp.view2',
'myApp.version'
]).
config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) {
$locationProvider.hashPrefix('!');
$routeProvider.otherwise({redirectTo: '/view1'});
}]);
Can say much about closure compiler, but you can also checkout below optimizations for angular1.x:
Lazy Loading - Allows dynamic loading for js files. So the app's size is significantly reduced
Webpack Bundling - Allows minification / uglification of your code.