This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
83 lines (75 loc) · 2.47 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
require("babel-register")();
var webpackConfig = require('./webpack.config.js');
var CORE = {
MAIN: [
'./node_modules/immutable/dist/immutable.min.js',
'./node_modules/react/dist/react-with-addons.min.js',
'./node_modules/react-dom/dist/react-dom.min.js'
],
POLYFILL: [
'./node_modules/babel-core/browser-polyfill.min.js'
]
}
module.exports = function(grunt) {
require('time-grunt')(grunt);
require('jit-grunt')(grunt);
grunt.initConfig({
// JS Tasks
webpack: {
development: webpackConfig.development,
production: webpackConfig.production,
static: webpackConfig.static
},
concat: {
options: {
stripBanners: {
block: true
}
},
production: {
files: {
'./src/trc quiz maker/public/core.js': CORE.MAIN,
'./src/trc quiz maker/public/core-compat.js': CORE.MAIN.concat(CORE.POLYFILL)
}
}
},
// Server Tasks
nodemon: {
dev: {
script: 'index.js',
options: {
watchedExtensions: ['js', 'json'],
ignore: ['node_modules/**', 'client/**', 'public/**', 'Gruntfile.js'],
env: {
PORT: process.env['TRC_QUIZ MAKER_PORT'] || 3000,
BABEL_ENV: 'development'
},
callback: function(nodemon) {
nodemon.on('log', function(event) {
console.log(event.colour);
});
}
}
}
},
karma: {
options: {
configFile: 'test/karma.conf.js'
},
development: {
singleRun: false,
autoWatch: true,
logLevel: 'INFO'
},
single: {
singleRun: true,
logLevel: 'ERROR'
}
}
});
grunt.registerTask('default', ['nodemon']);
grunt.registerTask('build', ['concat', 'webpack:production']);
grunt.registerTask('build:development', ['concat', 'webpack:development']);
grunt.registerTask('test', ['karma:single']);
grunt.registerTask('testing', ['karma:development']);
};