-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
71 lines (68 loc) · 1.9 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
module.exports = function(grunt) {
"use strict";
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.name %> - ver. <%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.production.author %>\n' +
'* License: MIT */\n',
savepath: {
dest: 'dest',
concat: 'concat',
},
clean: {
build: ["<%= savepath.dest %>/*.*", "<%= savepath.concat %>/*.*"],
},
concat: {
options: {
banner: '/*! <%= pkg.name %> modules - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n'+
' * (c) 2014 Wicker Wings\n'+
' * License: MIT\n'+
' ****/\n',
stripBanners: true,
separator: ';'
},
dist: {
src: ['modules/*.js'],
dest: '<%= savepath.concat %>/wm.js'
}
},
uglify: {
wicker: {
options: {
banner: '<%= banner %>'
},
files: {
'<%= savepath.dest %>/wicker.min.js': ['wicker.js']
}
},
mods: {
options: {
banner: '<%= concat.options.banner %>'
},
files: {
'<%= savepath.dest %>/wm.min.js': ['<%= concat.dist.dest %>']
}
}
},
jshint: {
files: ['Gruntfile.js', 'wicker.js', 'modules/**/*.js'],
options: {
strict : false,
unused : true, // 未使用変数を検出
//undef : true, // グローバル変数へのアクセスを禁止
browser : true, // ブラウザ用変数
globals: {
console: true
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('default', ['jshint', 'clean', 'concat', 'uglify:wicker', 'uglify:mods']);
grunt.registerTask('wicker', ['jshint', 'uglify:wicker']);
grunt.registerTask('mods', ['jshint', 'concat', 'uglify:mods']);
};