-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.ts
45 lines (41 loc) · 935 Bytes
/
Gruntfile.ts
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
import * as importedGrunt from "grunt";
type IGrunt = typeof importedGrunt;
// TODO add .graphql generation to build and watch
const sourceFiles = [
"src/server/**/*.ts",
"src/server/*.graphql",
"!src/client/**/*.ts",
"!node_modules/**/*.ts",
"!tmp/**",
"!./*.ts",
];
const taskOrder = ["copy", "ts"];
module.exports = (grunt: IGrunt) => {
grunt.initConfig({
watch: {
files: sourceFiles,
tasks: taskOrder,
},
copy: {
main: {
files: [
{
expand: true,
flatten: true,
src: ["src/server/*.graphql"],
dest: "dist/server/",
},
],
},
},
ts: {
default: {
tsconfig: "./tsconfig.server.json",
},
},
});
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-ts");
grunt.registerTask("default", taskOrder);
};