forked from linkesch/medium-editor-insert-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
102 lines (92 loc) · 2.58 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
build: {
options: {
banner: '/*! \n * <%= pkg.name %> v<%= pkg.version %> - <%= pkg.description %>\n *\n * <%= pkg.homepage %>\n * \n * Copyright (c) 2014 <%= pkg.author.name %> (<%= pkg.author.url %>)\n * Released under the <%= pkg.license %> license\n */\n\n'
},
src: ['src/js/medium-editor-insert-plugin.js', 'src/js/medium-editor-insert-images.js', 'src/js/medium-editor-insert-maps.js'],
dest: 'dist/js/<%= pkg.name %>.all.min.js'
},
f1: {
options: {
preserveComments: 'some'
},
src: 'src/js/medium-editor-insert-plugin.js',
dest: 'dist/js/addons/medium-editor-insert-plugin.min.js'
},
f2: {
options: {
preserveComments: 'some'
},
src: 'src/js/medium-editor-insert-images.js',
dest: 'dist/js/addons/medium-editor-insert-images.min.js'
},
f3: {
options: {
preserveComments: 'some'
},
src: 'src/js/medium-editor-insert-maps.js',
dest: 'dist/js/addons/medium-editor-insert-maps.min.js'
}
},
copy: {
main: {
files: [
{
expand: true,
cwd: 'src/js/',
src: ['*'],
dest: 'dist/js/addons/'
}
]
}
},
jshint: {
files: ['src/js/*.js', 'src/js/**/*.js', 'test/*.js', 'test/**/*.js'],
options: {
ignores: ['test/lib/**/*.js']
}
},
qunit: {
unit: 'test.html'
},
compass: {
dist: {
options: {
sassDir: 'src/sass',
cssDir: 'dist/css',
environment: 'production',
outputStyle: 'compressed'
}
}
},
watch: {
scripts: {
files: ['src/js/**/*.js'],
tasks: ['js'],
options: {
debounceDelay: 250
}
},
styles: {
files: 'src/sass/**/*.scss',
tasks: ['css'],
options: {
debounceDelay: 250
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('test', ['jshint', 'qunit']);
grunt.registerTask('js', ['test', 'uglify', 'copy']);
grunt.registerTask('css', ['compass']);
grunt.registerTask('default', ['js', 'css']);
};