This repository was archived by the owner on Aug 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathGruntfile.js
More file actions
73 lines (70 loc) · 2.33 KB
/
Gruntfile.js
File metadata and controls
73 lines (70 loc) · 2.33 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
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-karma');
//grunt.loadNpmTasks('grunt-ngdocs');
grunt.loadNpmTasks('grunt-conventional-changelog');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
//sgrunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
// external library versions
ngversion: '1.2.25',
libs: [],
dist: 'dist',
filename: 'angular-custom-element',
pkg: grunt.file.readJSON('package.json'),
srcDir: 'src/',
buildDir: '<%= dist %>',
meta: {
modules: 'angular.module("uiComponents", [<%= srcModules %>]);',
all: '<%= meta.srcModules %>',
banner: ['/*',
' * <%= pkg.name %>',
' * <%= pkg.repository.url %>\n',
' * Version: <%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>',
' * License: <%= pkg.license %>',
' */\n'].join('\n')
},
karma: {
options: {
configFile: 'test/karma.conf.js',
autoWatch: false,
browsers: ['PhantomJS']
},
unit: {
singleRun: true,
reporters: 'dots'
},
chrome: {
autoWatch: true,
browsers: ['Chrome']
}
},
uglify: {
options: {
banner: '<%= meta.banner %>'
//sourceMap: true,
//mangle: false
},
dist: {
src: ['src/angular-custom-element.js'],
dest: '<%= dist %>/<%= filename %>.min.js'
}
},
copy: {
dist: {
src: ['<%= dist %>/<%= filename %>.min.js'],
dest: '<%= dist %>/<%= filename %>-nopolyfill.min.js'
}
},
concat: {
distMin: {
options: {},
//src filled in by build task
src: ['lib/document-register-element.js', '<%= uglify.dist.dest %>'],
dest: '<%= dist %>/<%= filename %>.min.js'
}
}
});
grunt.registerTask('default', ['uglify:dist', 'copy:dist', 'concat:distMin']);
}