当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
2 Star 0 Fork 1

sloder/rongcloud-web-im-widget-h5
暂停

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Gruntfile.js 5.43 KB
一键复制 编辑 原始数据 按行查看 历史
yangchuan 提交于 2016-03-29 18:16 . init project just test
;
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
build: {
src: ["./build/*"]
},
demo: {
src: [
"./demo/widget/**/*",
"./demo/widget/**"
]
},
release:{
src:["./dist/*"]
},
temp:{
src:['./temp']
}
},
copy: {
demo: {
files: [{
expand: true,
cwd: "./build/",
src: "./**",
dest: "./demo/widget/"
}]
},
build: {
files: [
{
expand: true,
cwd: "./src/images/",
src: "./**",
dest: "./build/images/"
}
]
},
release:{
files:[
{
expand: true,
cwd: "./src/images/",
src: "./**",
dest: "./dist/images/"
}
]
}
},
connect: {
demo: {
options: {
port: 2014,
hostname: '*',
open: true,
keepalive: true,
base: ['./demo/']
}
}
},
typescript: {
build: {
src: ["./src/main.ts", "./src/**/*.ts"],
option: {
module: 'amd', //or commonjs
target: 'es5', //or es3
//basePath: 'path/to/typescript/files',
sourceMap: true,
declaration: false
},
dest: "./temp/main.js"
},
release:{
src: ["./src/main.ts", "./src/**/*.ts"],
option: {
module: 'amd', //or commonjs
target: 'es5', //or es3
//basePath: 'path/to/typescript/files',
sourceMap: true,
declaration: false
},
dest: "./temp/main.js"
}
},
watch: {
demo: {
options: {
spawn: false
},
files: ["./src/**"],
tasks: ["build", "clean:demo", "copy:demo"]
}
},
concat: {
build: {
files:[
{
src:[
'./bower_components/jquery/dist/jquery.js',
'./vendor/jqueryrebox/jquery-rebox.js',
'./bower_components/iscroll/build/iscroll.js',
'./bower_components/Swipe/swipe.js',
'./bower_components/ng-iscroll/src/ng-iscroll.js',
'./temp/main.js','./temp/myAppHTMLCache.js',
'./vendor/loadscript/script.min.js','./vendor/qiniu/qiniu.js'],
dest:'./build/main.js'
},
{
src:[
'./vendor/jqueryrebox/jquery-rebox.css',
'./bower_components/bootstrap/dist/css/bootstrap.min.css',
'./src/css/conversation.css',
],
dest:'./build/css/conversation.css'
}
]
},
release:{
files:[
{
src:[
'./bower_components/jquery/dist/jquery.js',
'./vendor/jqueryrebox/jquery-rebox.js',
'./bower_components/iscroll/build/iscroll.js',
'./bower_components/Swipe/swipe.js',
'./bower_components/ng-iscroll/src/ng-iscroll.min.js',
'./temp/main.js','./temp/myAppHTMLCache.js',
'./vendor/loadscript/script.min.js','./vendor/qiniu/qiniu.js'],
dest:'./dist/main.js'
},
{
src:[
'./vendor/jqueryrebox/jquery-rebox.css','./src/css/conversation.css',
],
dest:'./dist/css/conversation.css'
}
]
}
},
uglify:{
build:{
src:'./build/main.js',
dest:'./build/main.min.js'
},
release:{
src:'./dist/main.js',
dest:'./dist/main.min.js'
}
},
cssmin:{
build:{
src:'./build/css/conversation.css',
dest:'./build/css/conversation.min.css'
},
release:{
src:'./dist/css/conversation.css',
dest:'./dist/css/conversation.min.css',
}
},
ngtemplates: {
app: {
src: ["./src/ts/**/*.tpl.html"],
dest: "./temp/myAppHTMLCache.js",
options: {
module: 'RongWebIMWidget', //name of our app
htmlmin: {
collapseBooleanAttributes: true,
collapseWhitespace: true,
removeAttributeQuotes: true,
removeComments: true,
removeEmptyAttributes: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true
}
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks('grunt-typescript');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-angular-templates');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask("default", function() {
grunt.log.writeln("env" + process.env.path);
});
grunt.registerTask("build", ["clean:build", "typescript:build",
"ngtemplates:app","concat:build", "copy:build","clean:temp","uglify:build","cssmin:build"
]);
grunt.registerTask("release", ["clean:release", "typescript:release",
"ngtemplates:app","concat:release", "copy:release","clean:temp","uglify:release","cssmin:release"
]);
grunt.registerTask("demo", ["build", "clean:demo", "copy:demo",
"watch:demo"
]);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/sloder/rongcloud-web-im-widget-h5.git
git@gitee.com:sloder/rongcloud-web-im-widget-h5.git
sloder
rongcloud-web-im-widget-h5
rongcloud-web-im-widget-h5
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385