forked from alainyog/ngMarkdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
84 lines (82 loc) · 1.79 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
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
/*
* Concatinate the JavaScript files into one
*/
concat: {
js: {
src: ['wizMarkdown/src/libs/markdowndeep/MarkdownDeep.js',
'wizMarkdown/src/libs/markdowndeep/MarkdownDeepEditor.js',
'wizMarkdown/src/libs/highlight/highlight.min.js',
'wizMarkdown/src/*.mod.js',
'wizMarkdown/src/*.svc.js',
'wizMarkdown/src/*.fltr.js',
'wizMarkdown/src/*.dir.*.js'],
dest: 'wizMarkdown/wizMarkdown.js'
}
},
/*
* Minify the concatinated files
*/
uglify: {
js: {
files: {
'wizMarkdown/wizMarkdown.min.js': ['<%= concat.js.src %>']
}
}
},
/*
* Copy files into website
*/
copy: {
main: {
files: [
{
expand: true,
src: ['wizMarkdown/wizMarkdown*.js'],
dest: 'demo/app/libs/',
filter: 'isFile'
}
]
}
},
/*
* Watch for changes. If any concatinate and minify
*/
watch: {
dev: {
options: {
livereload: true
},
files: ['demo/index.html', '<%= concat.js.src %>'],
tasks: ['build']
}
},
/*
* Start a new server
*/
connect: {
options: {
hostname: 'localhost',
port: 9001
},
test: {
},
open: {
options: {
open: true,
livereload: true
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('build', 'Build site', ['concat', 'uglify', 'copy']);
grunt.registerTask('run', 'Build and run site', ['build', 'connect:open', 'watch']);
grunt.registerTask('default', 'Build and run site', ['run']);
};