当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Gruntfile.js 2.22 KB
一键复制 编辑 原始数据 按行查看 历史
IanLew 提交于 2018-04-08 22:52 . Modify some files
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
requirejs: {
options: {
banner: '/*! <%= pkg.name %>-<%= pkg.version %>.js create by <%= pkg.author %> <%= grunt.template.today("yyyy-mm-dd") %> */',
mainConfigFile: 'src/config/config.js',
baseUrl: 'src',
findNestedDependencies: true,
optimize: 'none',
onModuleBundleComplete: function(data) {
var fs = require('fs'),
amdclean = require('amdclean'),
outputFile = data.path;
fs.writeFileSync(outputFile, amdclean.clean({
filePath: outputFile,
wrap: {
start: this.banner + '\n(function(win, doc, undefined) {\n',
end: '\nwin.epg = epg;\n})(window, document);'
}
}));
},
include: ['<%= pkg.name %>'],
out: 'build/epg.js'
},
build: {}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
build: ['Gruntfile.js', 'build/<%= pkg.name %>.js']
},
uglify: {
options: {
banner: '/*! <%= pkg.name %>-<%= pkg.version %>.js create by <%= pkg.author %> <%= grunt.template.today("yyyy-mm-dd") %> */',
compress: false,
mangle: true
},
build: {
src: 'build/epg.js',
dest: 'build/<%= pkg.name %>.min.js'
}
},
watch: {
options: {
spawn: false
},
build: {
files: ['src/modules/**.js', 'src/**.js'],
tasks: ['jshint', 'requirejs', 'uglify']
}
}
});
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['requirejs', 'jshint', 'uglify', 'watch']);
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化