forked from stealjs/steal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
96 lines (94 loc) · 3.09 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
93
94
95
96
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*\n * <%= pkg.name %> v<%= pkg.version %>\n' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' * \n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n */'
},
concat: {
dist: {
src: [
'bower_components/es6-module-loader/dist/es6-module-loader.js',
'bower_components/systemjs/dist/system.js',
'src/start.js',
'src/normalize.js',
'src/core.js', // starts makeSteal
'src/system-extension-ext.js',
'src/system-extension-forward-slash.js',
'src/config.js',
'src/startup.js',
'src/make-steal-end.js', // ends makeSteal
'src/system-format-steal.js',
'src/end.js'
],
dest: '<%= pkg.name %>.js'
},
systemFormat: {
src: [
'src/system-format-start.js',
'src/normalize.js',
'src/system-format-steal.js',
'src/system-format-end.js'
],
dest: 'system-format-steal.js'
}
},
uglify: {
options: {
banner: '<%= meta.banner %>\n',
compress: {
drop_console: true
}
},
dist: {
options: {
banner: '<%= meta.banner %>\n'
+ '/*\n * ES6 Promises shim from when.js, Copyright (c) 2010-2014 Brian Cavalier, John Hann, MIT License\n */\n'
},
src: '<%= pkg.name %>.js',
dest: '<%= pkg.name %>.production.js'
}
},
copy: {
toTest: {
files: [
{expand: true, src: ['<%= pkg.name %>.js', '<%= pkg.name %>.production.js', 'dev.js'], dest: 'test/', filter: 'isFile'},
{expand: true, src: ['<%= pkg.name %>.js', '<%= pkg.name %>.production.js', 'dev.js'], dest: 'test/steal/', filter: 'isFile'},
{expand: true, src: ['<%= pkg.name %>.js', '<%= pkg.name %>.production.js', 'dev.js'], dest: 'test/bower_components/steal/', filter: 'isFile'},
{expand: true, cwd: 'bower_components/traceur/', src: ['*'], dest: 'test/bower_components/traceur/', filter: 'isFile'}
]
}
},
watch: {
files: [ "src/*.js", "bower_components/systemjs/dist/**"],
tasks: "default"
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
lib: ['src/**/*.js']
},
testee: {
tests: {
options: {
browsers: ['firefox'],
urls: ['test/test.html']
}
}
}
});
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('testee');
grunt.registerTask('test', [ 'build', 'testee' ]);
grunt.registerTask('build', [ /*'jshint', */'concat', 'uglify', 'copy:toTest' ]);
grunt.registerTask('default', [ 'build' ]);
};