This repository was archived by the owner on Feb 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathGruntFile.js
More file actions
85 lines (75 loc) · 2.17 KB
/
Copy pathGruntFile.js
File metadata and controls
85 lines (75 loc) · 2.17 KB
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
/* global module */
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// merge files from src/ into angularfire-multi-auth.js
concat: {
app: {
src: [
'src/module.js',
'src/**/*.js'
],
dest: 'dist/angularfire-multi-auth.js'
}
},
// Run shell commands
shell: {
options: {
stdout: true
},
protractor_install: {
command: 'node ./node_modules/protractor/bin/webdriver-manager update'
},
npm_install: {
command: 'npm install'
},
bower_install: {
command: 'bower install'
}
},
// Minify JavaScript
uglify: {
options: {
preserveComments: 'some'
},
app: {
files: {
'dist/angularfire-multi-auth.min.js': ['dist/angularfire-multi-auth.js']
}
}
},
// Lint JavaScript
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: ['src/**/*.js']
},
// Create local server
connect: {
testserver: {
options: {
hostname: 'localhost',
port: 3030
}
}
},
// End to end (e2e) tests
protractor: {
options: {
configFile: "tests/local_protractor.conf.js"
},
singlerun: {}
}
});
require('load-grunt-tasks')(grunt);
// Installation
grunt.registerTask('install', ['shell:protractor_install']);
grunt.registerTask('update', ['shell:npm_install', 'shell:bower_install']);
// Build tasks
grunt.registerTask('build', ['concat', 'jshint', 'uglify']);
grunt.registerTask('test:e2e', ['concat', 'connect:testserver', 'protractor:singlerun']);
// Default task
grunt.registerTask('default', ['build']);
};