This repository was archived by the owner on Oct 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGruntfile.js
More file actions
76 lines (67 loc) · 2.13 KB
/
Gruntfile.js
File metadata and controls
76 lines (67 loc) · 2.13 KB
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
/*
Coding to Learn and Create
Copyright 2019 OCAD University
Licensed under the 3-Clause BSD license. You may not use this file except in compliance with this license.
You may obtain a copy of the 3-Clause BSD License at
https://github.com/simonbates/c2lc-exploratory/raw/master/LICENSE.txt
*/
/* eslint-env node */
"use strict";
module.exports = function (grunt) {
grunt.config.init({
clean: {
build: ["build"]
},
copy: {
build: {
files: [
{
expand: true,
cwd: ".",
src: [
"node_modules/infusion/dist/infusion-all.js",
"src/**",
"icons/**",
"index.html",
"manifest.json",
"ServiceWorker.js",
"c2lc.css"
],
dest: "build"
}
]
}
},
connect: {
devServer: {
options: {
hostname: "127.0.0.1",
port: 8081,
keepalive: true
}
}
},
lintAll: {
sources: {
js: ["*.js"],
json: ["*.json"]
}
}
});
grunt.loadNpmTasks("gpii-grunt-lint-all");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.registerTask("createNojekyll",
"Create an empty build/.nojekyll file",
function () {
grunt.file.write("build/.nojekyll", "");
}
);
grunt.registerTask("build", "Build the project for deployment to a web server", [
"clean:build", "copy:build", "createNojekyll"
]);
grunt.registerTask("lint", "Perform lint checks", ["lint-all"]);
grunt.registerTask("server", "Run a local dev web server", ["connect:devServer"]);
grunt.registerTask("default", ["build"]);
};