fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
5.2 KiB

8 years ago
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ''
},
coreJs: {
src: [
'src/core/jquery.js',
'src/core/underscore.js',
'src/core/foundation.js',
'src/core/mvc/**/*.js',
'src/core/base.js',
'src/core/ob.js',
'src/core/widget.js',
'src/core/model.js',
'src/core/view.js',
'src/core/shortcut.js',
'src/core/utils/*.js',
'src/core/behavior/behavior.js',
'src/core/wrapper/layout.js',
'src/core/**/*.js',
'src/data/data.js',
8 years ago
'src/data/**/*.js',
'src/config.js'
8 years ago
],
dest: 'dist/core.js'
},
//最基础的控件
baseJs: {
src: [
'src/third/**/*.js',
'src/base/pane.js',
'src/base/single/single.js',
'src/base/single/text.js',
'src/base/single/button/button.basic.js',
'src/base/single/button/button.node.js',
8 years ago
'src/base/single/tip/tip.js',
'src/base/combination/group.button.js',
'src/base/combination/tree.button.js',
'src/base/combination/map.button.js',
'src/base/tree/treeview.js',
'src/base/tree/synctree.js',
'src/base/tree/parttree.js',
8 years ago
'src/base/**/*.js'
],
dest: 'dist/base.js'
},
//实现好的一些基础实例
caseJs: {
src: [
'src/case/combo/popup.bubble.js',
8 years ago
'src/case/**/*.js'
],
dest: 'dist/case.js'
},
widgetJs: {
src: [
'src/widget/paramsettingcombo/popup.param.js',
'src/widget/sequencetable/treenumber.sequencetable.js',
8 years ago
'src/widget/**/*.js',
'src/component/**/*.js'
],
dest: "dist/widget.js"
},
8 years ago
coreCss: {
8 years ago
src: ['src/css/core/**/*.css', 'src/css/utils/**/*.css'],
8 years ago
dest: 'dist/core.css'
},
baseCss: {
src: ['src/css/base/**/*.css'],
dest: 'dist/base.css'
8 years ago
},
widgetCss: {
src: ['src/css/widget/**/*.css'],
dest: 'dist/widget.css'
},
8 years ago
demoJs: {
8 years ago
src: ['demo/version.js', 'demo/app.js', 'demo/js/**/*.js', 'demo/config.js'],
8 years ago
dest: 'demo/dist/demo.js'
8 years ago
},
demoCss: {
src: ['demo/css/**/*.css'],
8 years ago
dest: 'demo/dist/demo.css'
8 years ago
}
},
8 years ago
less: {
main: {
expand: true,
cwd: 'demo/less',
src: ['**/*.less'],
dest: 'demo/css/',
ext: '.css'
},
dev: {
options: {
compress: true,
yuicompress: false
}
}
},
8 years ago
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'dist/core.min.js': ['<%= concat.coreJs.dest %>'],
'dist/base.min.js': ['<%= concat.baseJs.dest %>'],
'dist/case.min.js': ['<%= concat.caseJs.dest %>']
}
}
},
cssmin: {
coreCss: {
src: '<%= concat.coreCss.dest %>',
dest: 'dist/core.min.css'
},
baseCss: {
src: '<%= concat.baseCss.dest %>',
dest: 'dist/base.min.css'
}
},
jshint: {
files: ['Gruntfile.js', 'src/**/*.js'],
options: {
globals: {
jQuery: true,
console: true,
module: true,
document: true
}
}
},
watch: {
scripts: {
8 years ago
files: ['src/**/*.js', 'demo/js/**/*.js', 'demo/config.js', 'demo/less/**/*.less'],
8 years ago
tasks: ['less', 'concat'],
8 years ago
options: {
spanw: true,
interrupt: true
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
8 years ago
grunt.loadNpmTasks('grunt-contrib-less');
8 years ago
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
8 years ago
grunt.registerTask('default', ['less', 'concat', 'watch']);
8 years ago
};