This repository was archived by the owner on Jun 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgruntfile.js
87 lines (87 loc) · 2.69 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
src: {
options: {
reporter: require('jshint-stylish')
},
build: ['Gruntfile.js', 'src/**/*.js']
},
adapters: {
options: {
reporter: require('jshint-stylish')
},
build: ['adapters/*.js']
},
examples: {
options: {
reporter: require('jshint-stylish')
},
build: ['examples/*.js']
}
},
uglify: {
texty: {
options: {
banner: '/**\n * @license Texty v<%= pkg.version %>\n * (c) 2017 <%= pkg.author %>\n * License: <%= pkg.version %>\n */\n',
preserveComments: 'some'
},
files: {
'build/texty.min.js': 'tmp/texty.js',
}
},
rangy: {
options: {
preserveComments: 'some'
},
files: {
'build/rangy.min.js': ['node_modules/rangy/lib/rangy-core.js','node_modules/rangy/lib/rangy-classapplier.js']
}
}
},
watch: {
scripts: {
files: ['src/**/*.js', 'gruntfile.js'],
tasks: ['build'],
options: {
spawn: false,
}
},
adapters: {
files: ['adapters/*.js'],
tasks: ['jshint:adapters'],
options: {
spawn: false,
}
},
examples: {
files: ['examples/*.js'],
tasks: ['jshint:examples'],
options: {
spawn: false,
}
}
},
clean: {
build: ['build'],
tmp: ['tmp']
},
concat: {
options: {
separator: '',
},
texty: {
src: ['src/texty.prefix', 'src/**/*.js', 'src/texty.suffix'],
dest: 'tmp/texty.js',
}
},
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.registerTask('deploy', ['build', 'uglify:rangy']);
grunt.registerTask('build', ['concat', 'jshint:src', 'uglify:texty']);
};