-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
60 lines (52 loc) · 1.73 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
var url = require("url");
module.exports = function(grunt) {
grunt.config.init({
pkg: grunt.file.readJSON("package.json"),
shell: {
/** Build embedded viewer for use on real server deployments. */
build: {
command: './node_modules/.bin/webpack -p --bail'
},
/** Run the webpack dev server in with hot module reloading */
develop: {
command:
'echo "Viewer is available at ' +
'http://localhost:8080/viewer" && ' +
'./node_modules/.bin/webpack-dev-server ' +
'--config webpack.config.dev.babel.js --inline --hot'
}
},
clean: {
viewer: ["built/"]
},
jshint: {
player: {
options: {
jshintrc: true
},
files: {
src: ["src/scripts/*.js", "*.js"]
}
}
}
});
// Load external tasks
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-shell");
grunt.loadNpmTasks("grunt-contrib-jshint");
// Define our task aliases. The "player" task is the top-level task which
// should be run normally.
grunt.registerTask("default", ["player"]);
grunt.registerTask("build", [
"clean", "shell:build"
]);
grunt.registerTask("develop", [
"shell:develop"
]);
grunt.registerTask("player-custom-config",
"Build the player with a custom configuration.", function() {
grunt.option("player-config",
grunt.option("player-config") || "./config/custom.json");
grunt.task.run("player");
});
};