forked from tlovett1/custom-contact-forms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
68 lines (68 loc) · 1.89 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
module.exports = function ( grunt ) {
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),
uglify: {
js: {
files: {
'build/js/form-manager.min.js': ['build/js/form-manager.js'],
'build/js/form-mce.min.js': ['js/form-mce.js'],
'build/js/form-cpt-preview.min.js': ['js/form-cpt-preview.js'],
'build/js/form.min.js': ['js/form.js']
}
}
},
concat: {
dist: {
src: ['js/manager/utils.js', 'js/manager/mixins.js', 'js/manager/models.js', 'js/manager/collections.js', 'js/manager/views.js', 'js/manager/router.js', 'js/manager/app.js'],
dest: 'build/js/form-manager.js'
}
},
jshint: {
options: grunt.file.readJSON( '.jshintrc' ),
all: ['js/*', 'js/manager/*']
},
sass: {
dist: {
files: {
'build/css/form-manager.css': 'scss/form-manager.scss',
'build/css/form-mce.css': 'scss/form-mce.scss',
'build/css/form.css': 'scss/form.scss',
'build/css/admin.css': 'scss/admin.scss',
'build/css/form-cpt.css': 'scss/form-cpt.scss',
'build/css/form-table.css': 'scss/form-table.scss'
}
}
},
cssmin: {
dist: {
files: [{
expand: true,
cwd: 'build/css/',
src: ['*.css', '!*.min.css'],
dest: 'build/css/',
ext: '.min.css'
}]
}
},
qunit: {
all: [ 'tests/js/*.html' ]
},
watch: {
files: [
'js/*',
'js/manager/*',
'scss/*'
],
tasks: ['concat:dist', 'uglify', 'sass', 'cssmin:dist']
}
} );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-sass' );
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-contrib-qunit' );
grunt.registerTask( 'default', ['jshint', 'concat:dist', 'uglify:js', 'sass', 'cssmin:dist'] );
grunt.registerTask( 'test', [ 'qunit:all' ] );
};