Skip to content
This repository was archived by the owner on Feb 1, 2018. It is now read-only.

Commit 6c475a4

Browse files
committed
Combine & minify css and change the dist structure
1 parent 1b1891b commit 6c475a4

8 files changed

Lines changed: 52 additions & 39 deletions

File tree

GruntFile.js

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
21
module.exports = function(grunt) {
32
var srcPath = ["scripts/**/*.js"];
3+
var stylePath = ["styles/main.css", "styles/docs.css"];
44
var testePath = "spec/*Spec.js";
5-
var libPaths = ['polyfills/polyfill.js','bower_components/jquery/dist/jquery.min.js', 'bower_components/flatdoc/legacy.js' ,'bower_components/flatdoc/flatdoc.js', 'scripts/flatdoc-theme.js', 'bower_components/angular/angular.js', 'bower_components/angular-route/angular-route.js', 'bower_components/js-schema/js-schema.min.js', 'bower_components/google-code-prettify/bin/prettify.min.js', 'bower_components/bootstrap/dist/js/bootstrap.min.js'];
5+
var libPaths = ['polyfills/polyfill.js', 'bower_components/jquery/dist/jquery.min.js', 'bower_components/flatdoc/legacy.js', 'bower_components/flatdoc/flatdoc.js', 'scripts/flatdoc-theme.js', 'bower_components/angular/angular.js', 'bower_components/angular-route/angular-route.js', 'bower_components/js-schema/js-schema.min.js', 'bower_components/google-code-prettify/bin/prettify.min.js', 'bower_components/bootstrap/dist/js/bootstrap.min.js'];
66
grunt.initConfig({
77
concat: {
88
default: {
@@ -12,7 +12,7 @@ module.exports = function(grunt) {
1212
}
1313
},
1414
src: srcPath,
15-
dest: 'dist/main.js',
15+
dest: 'dist/js/main.js',
1616
}
1717
},
1818
jshint: {
@@ -28,59 +28,70 @@ module.exports = function(grunt) {
2828
},
2929
dist: {
3030
files: {
31-
'dist/main.min.js': [srcPath]
31+
'dist/js/main.min.js': [srcPath]
3232
}
3333
},
3434
unicfile: {
35-
files: {
36-
'dist/main.unique.js': libPaths.concat([srcPath])
37-
}
35+
files: {
36+
'dist/js/main.unique.js': libPaths.concat([srcPath])
3837
}
39-
},
38+
}
39+
},
40+
cssmin: {
41+
dev: {
42+
options: {
43+
report: "min"
44+
},
45+
src: stylePath,
46+
dest: "dist/css/main.min.css",
47+
}
48+
},
4049
jasmine: {
41-
pivotal: {
42-
src: [srcPath],
43-
options: {
44-
specs: testePath,
45-
helpers: 'spec/*Helper.js',
46-
vendor : libPaths,/*
47-
template: require('grunt-template-jasmine-istanbul'),
48-
templateOptions: {
49-
coverage: 'bin/coverage/coverage.json',
50-
report: 'bin/coverage',
51-
thresholds: {// we will use this soon
52-
lines: 100,
53-
statements: 100,
54-
branches: 100,
55-
functions: 100
56-
}
57-
}*/
58-
}
59-
}
60-
},
50+
pivotal: {
51+
src: [srcPath],
52+
options: {
53+
specs: testePath,
54+
helpers: 'spec/*Helper.js',
55+
vendor: libPaths,
56+
/*
57+
template: require('grunt-template-jasmine-istanbul'),
58+
templateOptions: {
59+
coverage: 'bin/coverage/coverage.json',
60+
report: 'bin/coverage',
61+
thresholds: {// we will use this soon
62+
lines: 100,
63+
statements: 100,
64+
branches: 100,
65+
functions: 100
66+
}
67+
}*/
68+
}
69+
}
70+
},
6171
watch: {
6272
scripts: {
6373
files: [srcPath, testePath],
64-
tasks: ['jshint', 'uglify', 'concat','jasmine' ],
74+
tasks: ['jshint', 'uglify', 'concat', 'jasmine'],
6575
options: {
6676
spawn: false,
6777
},
6878
},
6979
},
7080
bump: {
71-
options: {
72-
files: ['bower.json'],
73-
commitFiles: ["-a"],
74-
push: false
75-
}
81+
options: {
82+
files: ['bower.json'],
83+
commitFiles: ["-a"],
84+
push: false
85+
}
7686
}
7787
});
7888

7989
grunt.loadNpmTasks('grunt-contrib-jshint');
80-
grunt.loadNpmTasks('grunt-bump');
90+
grunt.loadNpmTasks('grunt-bump');
8191
grunt.loadNpmTasks('grunt-contrib-uglify');
92+
grunt.loadNpmTasks('grunt-contrib-cssmin');
8293
grunt.loadNpmTasks('grunt-contrib-concat');
8394
grunt.loadNpmTasks('grunt-contrib-watch');
8495
grunt.loadNpmTasks('grunt-contrib-jasmine');
85-
grunt.registerTask('default', ['jshint', 'jasmine', 'concat:default', 'uglify']);
86-
};
96+
grunt.registerTask('default', ['jshint', 'jasmine', 'concat:default', 'uglify', 'cssmin']);
97+
};

dist/css/main.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.
File renamed without changes.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"grunt-bump": "^0.7.0",
2020
"grunt-contrib-concat": "^0.5.1",
2121
"grunt-contrib-connect": "^0.10.1",
22+
"grunt-contrib-cssmin": "^1.0.0",
2223
"grunt-contrib-jasmine": "^0.9.2",
2324
"grunt-contrib-jshint": "^0.11.2",
2425
"grunt-contrib-uglify": "^0.9.1",

styles/docs.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700);
2-
31
.navbar-brand img{
42
display: block;
53
margin-top: -7px;

styles/main.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700);
2+
13
/**
24
*
35
* DocBase styling

0 commit comments

Comments
 (0)