-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathGruntfile.js
82 lines (66 loc) · 2.77 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
module.exports = function(grunt) {
require('matchdep').
filterDev('grunt-*').
filter(function(name){ return name !== 'grunt-cli'; }).
forEach(grunt.loadNpmTasks);
grunt.loadTasks('tasks');
function config(configFileName) {
return require('./configurations/' + configFileName);
}
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
env: process.env,
connect: config('connect'),
watch: config('watch'),
transpile: config('transpile'),
copy: config('copy'),
qunit: config('qunit'),
emberTemplates: config('ember_templates'),
concat: config('concat'),
sass: config('sass'),
shell: config('shell'),
s3: config('s3'),
jshint: config('jshint'),
clean: ["tmp"],
md5: config('md5'),
uglify: config('uglify')
});
grunt.registerTask("prod", function(){
process.env.GLAZIER_ENV = 'prod';
});
grunt.registerTask("jsframe", function(){
var fs = require('fs'),
jsf = require('jsframe'),
out = fs.openSync('tmp/public/vendor/conductor.js.html', 'w');
jsf.process('tmp/conductor.js', out);
});
grunt.registerTask("build:js", [
'emberTemplates',
'transpile',
'jshint',
]);
grunt.registerTask("build:css", ['sass', 'templateCSS:devOnly']);
grunt.registerTask('build', [
'clean',
'lock',
'build:js',
'build:css',
'copy_glazier',
'concat',
'jsframe',
'shell:buildCards', // slow
'copy:cards' ]);
grunt.registerTask('copy_glazier', ['copy:main', 'copy:test', 'copy:fixtures', 'copy:vendor']);
grunt.registerTask('assets', ['build', /*'uglify:all',*/ 'md5', 'index.html', 'templateCSS:prodOnly']);
grunt.registerTask('ingest', ['assets', 'shell:ingest']);
grunt.registerTask('deploy', ['prod', 'assets', 's3:prod', 'shell:ingestIndex']);
grunt.registerTask('deployCards', ['shell:deployCards', 'shell:herokuIngestCards']);
grunt.registerTask('ingestCards', ['shell:npmInstallForCards', 'build', 'shell:ingestCardManifests']);
grunt.registerTask('preview', ['build', /*'uglify:all',*/ 'md5', 'index.html', 'shell:ingest', 'connect', 'watch']);
grunt.registerTask('server', ['shell:glazierServer']);
grunt.registerTask('test', ['shell:npmInstallForCards', 'build', 'connect', 'unlock', 'qunit:all']);
grunt.registerTask('fastBoot',['build', 'index.html', 'templateCSS:devOnly', 'connect', 'unlock', 'watch']);
grunt.registerTask('default', ['shell:npmInstallForCards','fastBoot']);
grunt.registerTask('cloneCards', ['shell:cloneCards']);
grunt.registerTask('runInCards', ['shell:runInCards']);
};