This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGruntfile.js
122 lines (104 loc) · 3.67 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
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-clean');
// grunt.loadNpmTasks('grunt-contrib-uglify-es');
grunt.loadNpmTasks('grunt-git-authors');
grunt.loadNpmTasks('grunt-retire');
// N.B. The development build includes paths in the mapfile, at the browserify step, that are not accessable
// from the browser.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
authors: {
prior: [
"Ward Cunningham <[email protected]>",
"Stephen Judkins <[email protected]>",
"Sam Goldstein <[email protected]>",
"Steven Black <[email protected]>",
"Don Park <[email protected]>",
"Sven Dowideit <[email protected]>",
"Adam Solove <[email protected]>",
"Nick Niemeir <[email protected]>",
"Erkan Yilmaz <[email protected]>",
"Matt Niemeir <[email protected]>",
"Daan van Berkel <[email protected]>",
"Nicholas Hallahan <[email protected]>",
"Ola Bini <[email protected]>",
"Danilo Sato <[email protected]>",
"Henning Schumann <[email protected]>",
"Michael Deardeuff <[email protected]>",
"Pete Hodgson <[email protected]>",
"Marcin Cieslak <[email protected]>",
"M. Kelley Harris (http://www.kelleyharris.com)",
"Ryan Bennett <[email protected]>",
"Paul Rodwell <[email protected]>",
"David Turnbull <[email protected]>",
"Austin King <[email protected]>"
]
},
retire: {
js: ['client/js/*.js'],
options: {}
},
// tidy-up before we start the build
clean: ['build/*', 'client/client.js', 'client/client.map', 'client/client.*.js', 'client/client.*.map', 'client/test/testclient.js'],
browserify: {
// build the client that we will include in the package
packageClient: {
src: ['./client.coffee'],
dest: 'client/client.js',
options: {
transform: ['coffeeify', 'browserify-versionify'],
// transform: [['coffeeify', {transpile: {presets: ['@babel/preset-env']}}]],
browserifyOptions: {
extensions: ".coffee"
}
}
},
// build for local development version of the client will go here (once mapfile issues are resolved)
// build the browser testclient
testClient: {
src: ['./testclient.coffee'],
dest: 'client/test/testclient.js',
options: {
transform: [['coffeeify', {transpile: {presets: ['@babel/preset-env']}}]],
browserifyOptions: {
extensions: ".coffee"
}
}
}
},
mochaTest: {
test: {
options: {
timeout: false,
reporter: 'spec',
require: 'coffeescript/register'
},
src: [
'test/util.coffee',
'test/random.coffee',
'test/page.coffee',
'test/lineup.coffee',
'test/drop.coffee',
'test/revision.coffee',
'test/resolve.coffee',
'test/wiki.coffee'
]
}
},
watch: {
all: {
files: ['test/*.coffee', 'lib/*.coffee', '*.coffee'],
tasks: ['build']
}
}
});
// build without sourcemaps
grunt.registerTask('build', ['clean', 'browserify:packageClient', 'browserify:testClient']);
// check for out-of-date libraries and known vulnerabilities
grunt.registerTask('check', ['retire']);
// the default is to do the production build.
grunt.registerTask('default', ['build']);
};