-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
37 lines (30 loc) · 1.01 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
//先压缩后合并
uglify:{
options:{ // 配置uglify的参数
mangle: { except: ['Zepto'] }, // 防止混淆变量名时对jQuery产生影响
banner: '/* Powered by https://github.com/dszls */\n'
},
minify:{ // 配置uglify的执行目标
files:{
'src/jquery.dsselect.min.js': ['src/jquery.dsselect.js']
}
}
},
watch: {
css: {
files: ['src/jquery.dsselect.js'],
tasks: ['cache']
}
}
});
// 加载包含 "jshint,concat,uglify" 任务的插件。
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
// 默认被执行的任务列表。
grunt.registerTask('default', ['uglify']);
// grunt.registerTask('homepage', ['transport:homepage', 'concat:homepage', 'uglify:homepage', 'clean'])
};