-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
92 lines (82 loc) · 1.92 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
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-ts');
grunt.loadNpmTasks('grunt-browserify');
grunt.initConfig({
ts: {
//client: {
// src: ["src/js/shared/**/*.ts", "src/js/client/**/*.tsx"],
/*
dest: "src/static/bundle.js",
options: {
module: 'amd',
target: 'es5',
sourceMap: true,
declaration: true,
noImplicitAny: true,
strictNullChecks: true,
noImplicitAny: true,
noImplicitThis: true,
noUnusedLocals: true,
jsx: "react",
moduleResolution: "node",
}
},*/
all: {
src: ["src/js/{node,client,shared,tests}/**/*.{ts,tsx}"],
dest: "src/compiled/",
options: {
module: 'commonjs',
target: 'es5',
sourceMap: true,
declaration: true,
rootDir: 'src/js/',
noImplicitAny: true,
strictNullChecks: true,
noImplicitAny: true,
noImplicitThis: true,
noUnusedLocals: true,
lib: [ "es2016", "dom" ],
jsx: "react",
moduleResolution: "node",
}
},
},
browserify: {
client: {
src: ["src/compiled/{client,shared}/**/*.js"],
dest: "src/static/bundle.js",
options: {
browserifyOptions: {
extensions: ['.js'],
},
external: [ 'react', 'react-dom' ],
},
},
},
//babel: {
// all: {
// options: {
// sourceMap: true,
// presets: ['flow', 'react', 'env'],
// plugins: ["transform-class-properties"],
// },
// files: [{
// expand: true,
// cwd: 'src/js',
// src: ['**/*.js'],
// dest: 'src/compiled',
// ext: '.js',
// }],
// },
//},
//watch: {
// options: {
// atBegin: true,
// },
// babel: {
// files: ["src/js/{client,shared,node,tests}/**/*.js"],
// tasks: ["newer:babel:all", "newer:browserify:client"],
// },
//},
});
};