-
Notifications
You must be signed in to change notification settings - Fork 2
/
gruntfile.js
122 lines (115 loc) · 3.82 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/**
* Created by Kristof on 12/02/2015.
*/
module.exports = function(grunt) {
require("matchdep").filterAll("grunt-*").forEach(grunt.loadNpmTasks);
var webpack = require("webpack");
var webpackConfig = require("./webpack.config.js");
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
// the banner is inserted at the top of the output
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['dist/<%= pkg.name %>.js']
}
}
},
qunit: {
files: ['test/**/*.html']
},
jshint: {
// define the files to lint
files: ['gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
// configure JSHint (documented at http://www.jshint.com/docs/)
options: {
// more options here if you want to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true
}
}
},
bower: {
install: {
//just run 'grunt bower:install' and you'll see files from your Bower packages in lib directory
}
},
nugetpack: {
dist: {
src: 'nuget/indexedDBmock.nuspec',
dest: 'nuget/packages/',
options: {
version: '<%= version %>'
}
}
},
nugetpush: {
dist: {
src: 'nuget/packages/*.nupkg'
}
},
release: {
options: {
bump: false,
commitMessage: 'Release <%= version %>'
}
},
bump: {
options: {
updateConfigs: ['pkg'],
commit: false,
createTag: false,
push: false
}
},
webpack: {
options: webpackConfig,
"build-dev": {
devtool: "sourcemap",
debug: true
}
},
"webpack-dev-server": {
options: {
webpack: webpackConfig,
publicPath: "/" + webpackConfig.output.publicPath
},
start: {
keepAlive: true,
webpack: {
devtool: "eval",
debug: true
}
}
},
watch: {
files: ["src/**/*"],
tasks: ["jshint", "webpack:build-dev"],
options: {
spawn: false
}
}
});
//grunt.loadNpmTasks('grunt-contrib-uglify');
//grunt.loadNpmTasks('grunt-contrib-jshint');
//grunt.loadNpmTasks('grunt-contrib-qunit');
//grunt.loadNpmTasks('grunt-contrib-watch');
//grunt.loadNpmTasks('grunt-bower-task');
//grunt.loadNpmTasks('grunt-nuget');
//grunt.loadNpmTasks('grunt-release');
//grunt.loadNpmTasks('grunt-bump');
//grunt.loadNpmTasks('grunt-webpack');
// this would be run by typing "grunt test" on the command line
grunt.registerTask('test', ['jshint', 'bower', 'qunit']);
// the default task can be run just by typing "grunt" on the command line
grunt.registerTask('default', ['jshint', 'bower', 'webpack', 'qunit', 'uglify']);
grunt.registerTask('publish', ['publish:patch']);
grunt.registerTask('publish:patch', ['bump:patch', 'release', 'nugetpack', 'nugetpush']);
grunt.registerTask('publish:minor', ['bump:minor', 'release', 'nugetpack', 'nugetpush']);
grunt.registerTask('publish:major', ['bump:major', 'release', 'nugetpack', 'nugetpush']);
};