-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathGruntfile.js
82 lines (79 loc) · 2.48 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
const webpackConfig = require('./webpack.config');
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
clean: ["dist"],
bump: {
options: {
files: ['package.json'],
updateConfigs: ['pkg'],
commit: false,
createTag: false,
push: false,
prereleaseName: "beta"
}
},
release: {
options: {
bump: false,
commit: false,
add: false
}
},
nugetpack: {
dist: {
src: function () {
return 'nuspecs/Inputmask.phone.nuspec';
}(),
dest: 'build/',
options: {
version: '<%= pkg.version %>'
}
}
},
nugetpush: {
dist: {
src: 'build/InputMask.phone.<%= pkg.version %>.nupkg',
options: {
source: "https://www.nuget.org"
}
}
},
eslint: {
target: "lib/*.js"
},
availabletasks: {
tasks: {
options: {
filter: 'exclude',
tasks: ['availabletasks', 'default', 'updateDistConfig'],
showTasks: ['user']
}
}
},
webpack: {
main: webpackConfig("production")[0],
},
copy: {
phonecodes: {
expand: true,
cwd: 'lib',
src: 'phone-codes/*',
dest: 'dist/',
}
}
});
// Load the plugin that provides the tasks.
require('load-grunt-tasks')(grunt);
grunt.registerTask('publish', ['release', 'nugetpack', 'nugetpush']);
grunt.registerTask('publishnext', function () {
grunt.config('release.options.npmtag', "next");
grunt.task.run('release');
});
grunt.registerTask("validate", ["webpack", "copy", "eslint"]);
grunt.registerTask("build", ["bump:prerelease", "clean", "webpack", "copy"]);
grunt.registerTask("build:patch", ["bump:patch", "clean", "webpack", "copy"]);
grunt.registerTask("build:minor", ["bump:minor", "clean", "webpack", "copy"]);
grunt.registerTask("build:major", ["bump:major", "clean", "webpack", "copy"]);
grunt.registerTask("default", ["availabletasks"]);
};