This repository has been archived by the owner on Jul 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
gruntfile.js
executable file
·80 lines (75 loc) · 1.85 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
var path = require('path');
module.exports = function (grunt) {
'use strict';
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-newer');
grunt.loadNpmTasks('grunt-bumpup');
grunt.loadNpmTasks('grunt-jslint');
// Do grunt-related things in here
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
dev: {
options: {
paths: ['css'],
compress: false,
ieCompat: true,
},
files: {
'assets/css/styles.css': 'assets/less/colors.less'
}
},
prod: {
options: {
paths: ['css'],
compress: true,
ieCompat: true,
},
files: {
'assets/css/styles.min.css': 'assets/less/styles.less'
}
}
},
jslint: { // configure the task
// lint your project's server code
server: {
src: [ // some example files
'assets/js/scripts.js'
],
options: {
edition: 'latest', // specify an edition of jslint or use 'dir/mycustom-jslint.js' for own path
errorsOnly: true, // only display errors
failOnError: false // defaults to true
}
}
},
watch: {
options: {livereload: true},
less: {
files: ['assets/**/*.less'],
tasks: ['newer:less:dev'],
},
scripts: {
files: ['**/*.js', '*.html'],
tasks: ['jslint']
}
},
bumpup: {
file: 'package.json'
},
connect: {
server: {
options: {
port: 9005,
base: '',
hostname: '*',
livereload: true
}
}
}
});
grunt.task.registerTask('default', 'jslint');
grunt.task.registerTask('default', ['connect', 'watch']);
};