This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
/
gruntfile.js
69 lines (65 loc) · 1.77 KB
/
gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* Copyright 2013 The Polymer Authors. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
module.exports = function(grunt) {
ShadowDOM = grunt.file.readJSON('build.json');
grunt.initConfig({
karma: {
options: {
configFile: 'conf/karma.conf.js',
keepalive: true
},
buildbot: {
reporters: ['crbot'],
logLevel: 'OFF'
},
ShadowDOM: {
}
},
uglify: {
ShadowDOM: {
options: {
compress: {
// TODO(sjmiles): should be false by default (?)
// https://github.com/mishoo/UglifyJS2/issues/165
unsafe: false
},
banner: grunt.file.read('LICENSE')
//compress: true, Xmangle: true, beautify: true, unsafe: false
},
files: {
'ShadowDOM.min.js': ShadowDOM
}
}
},
yuidoc: {
compile: {
name: '<%= pkg.name %>',
description: '<%= pkg.description %>',
version: '<%= pkg.version %>',
url: '<%= pkg.homepage %>',
options: {
exclude: 'third_party',
paths: '.',
outdir: 'docs',
linkNatives: 'true',
tabtospace: 2,
themedir: '../docs/doc_themes/simple'
}
}
},
pkg: grunt.file.readJSON('package.json')
});
// plugins
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-yuidoc');
grunt.loadNpmTasks('grunt-karma');
// tasks
grunt.registerTask('default', ['uglify']);
grunt.registerTask('minify', ['uglify']);
grunt.registerTask('docs', ['yuidoc']);
grunt.registerTask('test', ['karma:ShadowDOM']);
grunt.registerTask('test-buildbot', ['karma:buildbot']);
};