Skip to content

Commit 8956b7e

Browse files
author
Valentin Hervieu
committed
Refactor build process
1 parent 087948b commit 8956b7e

File tree

8 files changed

+38
-38
lines changed

8 files changed

+38
-38
lines changed

Gruntfile.js

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
module.exports = function (grunt) {
1+
module.exports = function(grunt) {
2+
var banner = '/*! <%= pkg.name %> - v<%= pkg.version %> - \n' +
3+
' (c) <%= pkg.author %> - \n'+
4+
' <%= pkg.repository.url %> - \n' +
5+
' <%= grunt.template.today("yyyy-mm-dd") %> */\n',
6+
minBanner = banner.replace(/\n/g, '') + '\n';
7+
28
// Project configuration.
39
grunt.initConfig({
410

511
pkg: grunt.file.readJSON('package.json'),
612

7-
minBanner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
8-
'(c) <%= pkg.author %>, <%= pkg.repository.url %> - ' +
9-
'<%= grunt.template.today("yyyy-mm-dd") %> */\n',
13+
minBanner: minBanner,
1014

1115
recess: {
1216
options: {
@@ -58,10 +62,10 @@ module.exports = function (grunt) {
5862
removeStyleLinkTypeAttributes: true
5963
},
6064
module: 'rzModule',
61-
url: function (url) {
65+
url: function(url) {
6266
return url.replace('src/', '');
6367
},
64-
bootstrap: function (module, script) {
68+
bootstrap: function(module, script) {
6569
return 'module.run(function($templateCache) {\n' + script + '\n});';
6670
}
6771
}
@@ -85,6 +89,21 @@ module.exports = function (grunt) {
8589
}
8690
},
8791

92+
concat: {
93+
options: {
94+
stripBanners: true,
95+
banner: banner
96+
},
97+
js: {
98+
src: ['dist/rzslider.js'],
99+
dest: 'dist/rzslider.js',
100+
},
101+
css: {
102+
src: ['dist/rzslider.css'],
103+
dest: 'dist/rzslider.css',
104+
},
105+
},
106+
88107
ngAnnotate: {
89108
options: {
90109
singleQuotes: true,
@@ -131,6 +150,7 @@ module.exports = function (grunt) {
131150
grunt.loadNpmTasks('grunt-recess');
132151
grunt.loadNpmTasks('grunt-angular-templates');
133152
grunt.loadNpmTasks('grunt-replace');
153+
grunt.loadNpmTasks('grunt-contrib-concat');
134154
grunt.loadNpmTasks('grunt-ng-annotate');
135155
grunt.loadNpmTasks('grunt-contrib-watch');
136156
grunt.loadNpmTasks('grunt-serve');
@@ -140,5 +160,5 @@ module.exports = function (grunt) {
140160
grunt.registerTask('test', ['karma']);
141161

142162
grunt.registerTask('css', ['recess']);
143-
grunt.registerTask('js', ['ngtemplates', 'replace', 'ngAnnotate', 'uglify']);
163+
grunt.registerTask('js', ['ngtemplates', 'replace','concat', 'ngAnnotate', 'uglify']);
144164
};

dist/rzslider.css

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
/**
2-
* Angular JS slider directive
3-
*
4-
* (c) Rafal Zajac <[email protected]>
5-
* http://github.com/rzajac/angularjs-slider
6-
*
7-
* Licensed under the MIT license
8-
*/
9-
10-
/* Slider colors */
11-
12-
/* Slider size parameters */
13-
1+
/*! angularjs-slider - v2.2.0 -
2+
(c) Rafal Zajac <[email protected]>, Valentin Hervieu <[email protected]>, Jussi Saarivirta <[email protected]>, Angelin Sirbu <[email protected]> -
3+
https://github.com/rzajac/angularjs-slider.git -
4+
2015-12-20 */
145
rzslider {
156
position: relative;
167
display: inline-block;

dist/rzslider.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
/**
2-
* Angular JS slider directive
3-
*
4-
* (c) Rafal Zajac <[email protected]>
5-
* http://github.com/rzajac/angularjs-slider
6-
*
7-
* Version: v2.2.0
8-
*
9-
* Licensed under the MIT license
10-
*/
11-
1+
/*! angularjs-slider - v2.2.0 -
2+
(c) Rafal Zajac <[email protected]>, Valentin Hervieu <[email protected]>, Jussi Saarivirta <[email protected]>, Angelin Sirbu <[email protected]> -
3+
https://github.com/rzajac/angularjs-slider.git -
4+
2015-12-20 */
125
/*jslint unparam: true */
136
/*global angular: false, console: false, define, module */
147
(function(root, factory) {

dist/rzslider.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rzslider.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"chai-things": "^0.2.0",
1919
"grunt": "~0.4.2",
2020
"grunt-angular-templates": "^0.5.7",
21+
"grunt-contrib-concat": "^0.5.1",
2122
"grunt-contrib-mincss": "~0.3.2",
2223
"grunt-contrib-uglify": "~0.2.2",
2324
"grunt-contrib-watch": "^0.6.1",

src/rzslider.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44
* (c) Rafal Zajac <[email protected]>
55
* http://github.com/rzajac/angularjs-slider
66
*
7-
* Version: v2.2.0
8-
*
97
* Licensed under the MIT license
108
*/
11-
129
/*jslint unparam: true */
1310
/*global angular: false, console: false, define, module */
1411
(function(root, factory) {

src/variables.less

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
border-radius: @radius;
55
}
66

7-
/* Slider colors */
87
@handleActiveColor: #451aff;
98
@handleHoverColor: #fff;
109
@labelTextColor: #55637d;
@@ -21,7 +20,6 @@
2120
@ticksHeight: 10px;
2221
@ticksValuePosition: -30px;
2322

24-
/* Slider size parameters */
2523
@handleSize: 32px;
2624
@handlePointerSize: 8px;
2725
@bubblePadding: 1px 3px;

0 commit comments

Comments
 (0)