forked from linkesch/medium-editor-insert-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
144 lines (131 loc) · 3.27 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
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',
uglify: {
dist: {
options: {
banner: '<%= banner %>'
},
src: ['src/js/medium-editor-insert-plugin.js', 'src/js/*.js'],
dest: 'dist/js/<%= pkg.name %>.all.min.js'
},
addons: {
options: {
banner: '<%= banner %>'
},
files: [{
expand: true,
cwd: 'src/js',
src: '**/*.js',
dest: 'dist/js/addons',
ext: '.min.js'
}]
}
},
concat: {
dist: {
options: {
banner: '<%= banner %>'
},
src: ['src/js/medium-editor-insert-plugin.js', 'src/js/*.js'],
dest: 'dist/js/<%= pkg.name %>.all.js'
},
addons: {
options: {
banner: '<%= banner %>'
},
files: [{
expand: true,
cwd: 'src/js',
src: '**/*.js',
dest: 'dist/js/addons',
ext: '.js'
}]
}
},
jshint: {
files: ['src/js/*.js', 'src/js/**/*.js', 'test/*.js', 'test/**/*.js'],
options: {
jshintrc: true,
ignores: ['test/lib/**/*.js']
}
},
qunit: {
unit: 'test.html'
},
sass: {
dist: {
files: [{
expand: true,
cwd: 'src/sass/',
src: ['*.scss'],
dest: 'dist/css/',
ext: '.css'
}]
}
},
autoprefixer: {
dist: {
src: 'dist/css/*.css'
}
},
csso: {
dist: {
options: {
banner: '<%= banner %>'
},
expand: true,
cwd: 'dist/css/',
src: ['*.css', '!*.min.css'],
dest: 'dist/css/',
ext: '.min.css'
}
},
usebanner: {
dist: {
options: {
banner: '<%= banner %>',
linebreak: false
},
files: [{
expand: true,
cwd: 'dist/css/',
src: ['*.css', '!*.min.css'],
dest: 'dist/css/',
ext: '.css'
}]
}
},
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-concat');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-csso');
grunt.loadNpmTasks('grunt-banner');
grunt.registerTask('test', ['jshint', 'qunit']);
grunt.registerTask('js', ['test', 'uglify', 'concat']);
grunt.registerTask('css', ['sass', 'autoprefixer', 'csso', 'usebanner']);
grunt.registerTask('default', ['js', 'css']);
};