-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGruntfile.js
72 lines (69 loc) · 2.29 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
editor: {
src: 'src/editor/editor.scss',
dest: 'build/css/editor.css'
}
},
concat: {
engine: {
options: { separator: ';' + grunt.util.linefeed },
src: ['src/engine/libs/*.js', 'src/engine/*.js'],
dest: 'dist/js/Danimator.js'
},
audio: {
options: { separator: ';' + grunt.util.linefeed },
src: ['src/audio/libs/*.js', 'src/audio/*.js'],
dest: 'dist/js/Danimator.audio.js'
},
editor: {
options: { separator: ';' + grunt.util.linefeed },
src: ['src/editor/libs/*.js','src/editor/*.js'],
dest: 'build/js/Danimator.editor.js'
},
styles: {
src: ['src/editor/libs/*.css', 'build/css/editor.css'],
dest: 'build/css/Danimator.editor.css'
}
},
cssmin: {
editor: {
src: 'build/css/Danimator.editor.css',
dest:'dist/css/Danimator.editor.min.css'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> v<%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
compress: {},
mangle: true,
sourceMap: true
},
engine: { files: {'dist/js/Danimator.min.js': ['dist/js/Danimator.js'] }},
audio: { files: {'dist/js/Danimator.audio.min.js': ['dist/js/Danimator.audio.js'] }},
editor: { files: {'dist/js/Danimator.editor.min.js': ['build/js/Danimator.editor.js'] }, options: { sourceMap: false }}
},
watch: {
engine: {
files: ['src/engine/*.js', 'src/engine/*/*.js'],
tasks: ['concat:engine', 'uglify:engine']
},
audio: {
files: ['src/audio/*.js', 'src/audio/*/*.js'],
tasks: ['concat:audio', 'uglify:audio']
},
editor: {
files: ['src/editor/*.js', 'src/editor/*/*.js'],
tasks: ['concat:editor', 'uglify:editor']
},
styles: {
files: ['src/editor/*.scss'],
tasks: ['sass', 'concat:styles', 'cssmin']
}
}
});
require('load-grunt-tasks')(grunt);
grunt.registerTask('default', ['sass', 'concat', 'cssmin', 'uglify', 'watch']);
};