Merge pull request #196 from sorich87/minify

create minified JS and CSS in dist folder
This commit is contained in:
Adam Bradley
2013-11-27 06:43:11 -08:00
15 changed files with 167 additions and 21 deletions

View File

@@ -1,8 +1,6 @@
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';\n'
@@ -44,7 +42,7 @@ module.exports = function(grunt) {
'js/controllers/tabBarController.js'
],
dest: 'dist/js/<%= pkg.name %>.js'
dest: 'dist/js/ionic.js'
},
distAngular: {
src: [
@@ -53,7 +51,7 @@ module.exports = function(grunt) {
'js/ext/angular/src/service/**/*.js',
'js/ext/angular/src/directive/**/*.js'
],
dest: 'dist/js/<%= pkg.name %>-angular.js'
dest: 'dist/js/ionic-angular.js'
}
},
jshint: {
@@ -62,6 +60,17 @@ module.exports = function(grunt) {
jshintrc: '.jshintrc'
}
},
uglify: {
dist: {
files: {
'dist/js/ionic.min.js': 'dist/js/ionic.js',
'dist/js/ionic-angular.min.js': 'dist/js/ionic-angular.js'
}
},
options: {
preserveComments: 'some'
}
},
sass: {
dist: {
files: {
@@ -70,6 +79,14 @@ module.exports = function(grunt) {
}
}
},
cssmin: {
dist: {
files: {
'dist/css/ionic.min.css': 'dist/css/ionic.css',
'dist/css/themes/ionic-ios7.min.css': 'dist/css/themes/ionic-ios7.css'
}
}
},
watch: {
scripts: {
files: ['js/**/*.js', 'ext/**/*.js'],
@@ -94,6 +111,13 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask('default', ['jshint', 'sass', 'concat']);
grunt.registerTask('default', [
'jshint',
'sass',
'cssmin',
'concat',
'uglify'
]);
};

2
dist/css/ionic.css vendored
View File

@@ -9,7 +9,7 @@
* By @maxlynch, @helloimben, @adamdbradley <3
*
* Licensed under the MIT license. Please see LICENSE for more information.
*
*
*/
/*!
Ionicons, v1.3.6

18
dist/css/ionic.min.css vendored Normal file
View File

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,16 @@
/*!
* Copyright 2013 Drifty Co.
* http://drifty.com/
* Ionic - a powerful HTML5 mobile app framework.
* http://ionicframework.com/
*
*
* By @maxlynch, @helloimben, @adamdbradley <3
*
* Licensed under the MIT license. Please see LICENSE for more information.
*
*/
/**
* Nav controllers and header bar animations
*/

13
dist/css/themes/ionic-ios7.min.css vendored Normal file
View File

@@ -0,0 +1,13 @@
/*!
* Copyright 2013 Drifty Co.
* http://drifty.com/
* Ionic - a powerful HTML5 mobile app framework.
* http://ionicframework.com/
*
*
* By @maxlynch, @helloimben, @adamdbradley <3
*
* Licensed under the MIT license. Please see LICENSE for more information.
*
*/.content-slide-out.ng-enter,.content-slide-out>.ng-enter{z-index:1;-webkit-transition:.5s ease-in-out all;-webkit-transform:translate3d(-100%,0,0);box-shadow:-1px 0 10px rgba(0,0,0,.6)}.content-slide-out.ng-enter-active,.content-slide-out>.ng-enter-active{-webkit-transform:translate3d(0,0,0)}.content-slide-out.ng-leave,.content-slide-out>.ng-leave{z-index:0;-webkit-transition:.5s ease-in-out all;-webkit-transform:translate3d(0%,0,0)}.content-slide-out.ng-leave-active,.content-slide-out>.ng-leave-active{-webkit-transform:translate3d(10%,0,0);opacity:.8}.bar-title-in-add{-webkit-transition:-webkit-transform .5s ease-in-out,opacity .5s ease-in-out;-webkit-transform:translate3d(100%,0,0);opacity:0}.bar-title-in-add-active{-webkit-transform:translate3d(0px,0,0);opacity:1}.bar-title-out-add{-webkit-transition:-webkit-transform .5s ease-in-out,opacity .5s ease-in-out}.bar-title-out-add-active{-webkit-transform:translate3d(-100%,0,0);opacity:0}.bar-button-in{opacity:0}.bar-button-in-add{-webkit-transition:-webkit-transform .5s ease-in-out,opacity .5s ease-in-out;-webkit-transform:translate3d(50%,0,0);opacity:0}.bar-button-in-active{-webkit-transform:translate3d(0px,0,0);opacity:1}.fade-in-out.ng-enter,.fade-in-out>.ng-enter{opacity:0;-webkit-transition:opacity .3s ease-in-out}.fade-in-out.ng-enter-active,.fade-in-out>.ng-enter-active{opacity:1}.fade-in-out.ng-leave,.fade-in-out>.ng-leave{opacity:1;-webkit-transition:opacity .3s ease-in-out}.fade-in-out.ng-leave-active,.fade-in-out>.ng-leave-active{opacity:0}.toggle{display:inline-block}.toggle input{display:none}.toggle .track{position:relative;display:inline-block;box-sizing:border-box;width:54px;height:32px;border:solid 2px #ddd;border-radius:20px;background-color:#fff;cursor:pointer;transition:.4s ease}.toggle .handle{position:absolute;display:block;width:auto;height:auto;box-shadow:0 0 2px rgba(0,0,0,.5),0 4px 5px rgba(0,0,0,.25);border-radius:20px;background-color:#fff;left:0;top:0;bottom:0;right:20px;transition:.2s ease;transition-property:left,right;transition-delay:0s,.05s}.toggle :checked+.track{border-color:#4bd863;background-color:#ccc;box-shadow:inset 0 0 0 20px #4bd863;transition:.2s ease}.toggle :checked+.track .handle{background-color:#fff;right:0;left:20px;-webkit-transform:none;transition-delay:.05s,0s}

View File

@@ -1,4 +1,4 @@
/**
/*!
* Copyright 2013 Drifty Co.
* http://drifty.com/
@@ -9,7 +9,7 @@
* By @maxlynch, @helloimben, @adamdbradley <3
*
* Licensed under the MIT license. Please see LICENSE for more information.
*
*
*/
;
/**
@@ -445,7 +445,7 @@ angular.module('ionic.service.templateLoad', [])
angular.module('ionic.ui.actionSheet', [])
.directive('actionSheet', function($document) {
.directive('actionSheet', ['$document', function($document) {
return {
restrict: 'E',
scope: true,
@@ -487,7 +487,7 @@ angular.module('ionic.ui.actionSheet', [])
'</div>' +
'</div>'
};
});
}]);
})();
;
@@ -1823,7 +1823,7 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture'])
* extends our core Ionic side menu controller and exposes
* some side menu stuff on the current scope.
*/
.controller('SideMenuCtrl', function($scope) {
.controller('SideMenuCtrl', ['$scope', function($scope) {
var _this = this;
angular.extend(this, ionic.controllers.SideMenuController.prototype);
@@ -1843,7 +1843,7 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture'])
$scope.sideMenuContentTranslateX = 0;
$scope.sideMenuController = this;
})
}])
.directive('sideMenus', function() {
return {

48
dist/js/ionic-angular.min.js vendored Normal file
View File

File diff suppressed because one or more lines are too long

4
dist/js/ionic.js vendored
View File

@@ -1,4 +1,4 @@
/**
/*!
* Copyright 2013 Drifty Co.
* http://drifty.com/
@@ -9,7 +9,7 @@
* By @maxlynch, @helloimben, @adamdbradley <3
*
* Licensed under the MIT license. Please see LICENSE for more information.
*
*
*/
;

15
dist/js/ionic.min.js vendored Normal file
View File

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
/**
/*!
* Copyright 2013 Drifty Co.
* http://drifty.com/
@@ -9,5 +9,5 @@
* By @maxlynch, @helloimben, @adamdbradley <3
*
* Licensed under the MIT license. Please see LICENSE for more information.
*
*
*/

View File

@@ -3,7 +3,7 @@
angular.module('ionic.ui.actionSheet', [])
.directive('actionSheet', function($document) {
.directive('actionSheet', ['$document', function($document) {
return {
restrict: 'E',
scope: true,
@@ -45,6 +45,6 @@ angular.module('ionic.ui.actionSheet', [])
'</div>' +
'</div>'
};
});
}]);
})();

View File

@@ -14,7 +14,7 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture'])
* extends our core Ionic side menu controller and exposes
* some side menu stuff on the current scope.
*/
.controller('SideMenuCtrl', function($scope) {
.controller('SideMenuCtrl', ['$scope', function($scope) {
var _this = this;
angular.extend(this, ionic.controllers.SideMenuController.prototype);
@@ -34,7 +34,7 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture'])
$scope.sideMenuContentTranslateX = 0;
$scope.sideMenuController = this;
})
}])
.directive('sideMenus', function() {
return {

View File

@@ -7,6 +7,7 @@
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.4",

View File

@@ -11,7 +11,7 @@
* By @maxlynch, @helloimben, @adamdbradley <3
*
* Licensed under the MIT license. Please see LICENSE for more information.
*
*
*/
@import

View File

@@ -1,5 +1,19 @@
@charset "UTF-8";
/*!
* Copyright 2013 Drifty Co.
* http://drifty.com/
* Ionic - a powerful HTML5 mobile app framework.
* http://ionicframework.com/
*
*
* By @maxlynch, @helloimben, @adamdbradley <3
*
* Licensed under the MIT license. Please see LICENSE for more information.
*
*/
@import
"../../mixins",
"../../variables",