-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
54 lines (52 loc) · 2.08 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
//Grunt is just JavaScript running in node, after all...
module.exports = function(grunt) {
// All upfront config goes in a massive nested object.
grunt.initConfig({
// You can set arbitrary key-value pairs.
tempFolder: 'temp',
distFolder: 'dist',
// You can also set the value of a key as parsed JSON.
// Allows us to reference properties we declared in package.json.
pkg: grunt.file.readJSON('package.json'),
// Grunt tasks are associated with specific properties.
// these names generally match their npm package name.
concat: {
// Specify some options, usually specific to each plugin.
options: {
// Specifies string to be inserted between concatenated files.
separator: '\n\n'
},
// 'dist' is what is called a "target."
// It's a way of specifying different sub-tasks or modes.
dist: {
// The files to concatenate:
// Notice the wildcard, which is automatically expanded.
src: ['shared/*.js', 'shared/**/_*.js', 'shared/**/[a-zA-Z]*.js'],
// The destination file:
// Notice the angle-bracketed ERB-like templating,
// which allows you to reference other properties.
// This is equivalent to 'dist/main.js'.
dest: '<%= tempFolder %>/hook_components.js'
// You can reference any grunt config property you want.
// Ex: '<%= concat.options.separator %>' instead of ';'
},
makeMain: {
src: ['temp/hook_components.js', 'temp/template.js'],
dest: '<%= distFolder %>/main.js'
}
},
ngtemplates: {
'SharedComponents': {
src: 'shared/**/*.html',
dest: '<%= tempFolder %>/template.js'
}
}
}); // The end of grunt.initConfig
// We've set up each task's configuration.
// Now actually load the tasks.
// This will do a lookup similar to node's require() function.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-angular-templates');
// Register our own custom task alias.
grunt.registerTask('build', ['concat:dist','ngtemplates','concat:makeMain']);
};