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.

340 lines
12 KiB

8 years ago
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ''
},
polyfillJs: {
src: ['src/polyfill/**/*.js'],
7 years ago
dest: 'dist/polyfill.js'
},
8 years ago
coreJs: {
src: [
'src/core/jquery.js',
'src/core/underscore.js',
'src/core/foundation.js',
7 years ago
// 'src/core/mvc/**/*.js',
8 years ago
'src/core/base.js',
'src/core/ob.js',
'src/core/widget.js',
7 years ago
// 'src/core/model.js',
// 'src/core/view.js',
8 years ago
'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',
7 years ago
'src/data/**/*.js'
8 years ago
],
7 years ago
dest: 'dist/core.js'
8 years ago
},
8 years ago
8 years ago
//最基础的控件
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',
8 years ago
'src/base/tree/asynctree.js',
'src/base/tree/parttree.js',
8 years ago
'src/base/**/*.js'
],
7 years ago
dest: 'dist/base.js'
8 years ago
},
//实现好的一些基础实例
caseJs: {
src: [
'src/case/combo/popup.bubble.js',
8 years ago
'src/case/**/*.js'
],
7 years ago
dest: 'dist/case.js'
8 years ago
},
widgetJs: {
src: [
'src/widget/paramsettingcombo/popup.param.js',
'src/widget/sequencetable/treenumber.sequencetable.js',
8 years ago
'src/widget/**/*.js',
'src/component/**/*.js'
],
7 years ago
dest: 'dist/widget.js'
},
8 years ago
chartJs: {
src: [
'src/addons/chart/chart.js',
'src/addons/chart/chart.combine.js',
'src/addons/chart/factory.charts.js',
'src/addons/chart/**/*.js'
],
7 years ago
dest: 'dist/chart.js'
},
sliderJs: {
7 years ago
src: [
7 years ago
'src/addons/sliders/js/**/*.js'
7 years ago
],
7 years ago
dest: 'dist/sliders.js'
7 years ago
},
7 years ago
sliderCss: {
src: [
7 years ago
'src/addons/sliders/**/*.css'
7 years ago
],
7 years ago
dest: 'dist/sliders.css'
7 years ago
},
7 years ago
jqueryuiJs: {
7 years ago
src: [
7 years ago
'src/addons/sliders/lib/jquery.ui.core.js',
'src/addons/sliders/lib/jquery.ui.core.js',
'src/addons/sliders/lib/jquery.ui.widget.js',
'src/addons/sliders/lib/jquery.ui.mouse.js',
'src/addons/sliders/lib/jquery.ui.position.js',
'src/addons/sliders/lib/jquery.ui.resizable.js',
'src/addons/sliders/lib/jquery.ui.draggable.js',
'src/addons/sliders/lib/jquery.ui.droppable.js',
'src/addons/sliders/lib/jquery.ui.sortable.js'
7 years ago
],
7 years ago
dest: 'dist/jqueryui.js'
8 years ago
},
8 years ago
coreCss: {
8 years ago
src: ['src/css/core/**/*.css', 'src/css/theme/**/*.css'],
7 years ago
dest: 'dist/core.css'
8 years ago
},
baseCss: {
src: ['src/css/base/**/*.css'],
7 years ago
dest: 'dist/base.css'
8 years ago
},
widgetCss: {
src: ['src/css/widget/**/*.css'],
7 years ago
dest: 'dist/widget.css'
},
8 years ago
resourceCss: {
src: ['src/css/resource/**/*.css'],
7 years ago
dest: 'dist/resource.css'
8 years ago
},
8 years ago
7 years ago
bundleJs: {
src: ['public/js/index.js', 'dist/core.js', 'dist/base.js', 'dist/case.js', 'dist/widget.js', 'public/js/**/*.js'],
7 years ago
dest: 'dist/bundle.js'
7 years ago
},
7 years ago
bundleCss: {
src: ['dist/core.css', 'dist/base.css', 'dist/widget.css', 'public/css/app.css', 'public/css/**/*.css'],
dest: 'dist/bundle.css'
7 years ago
},
7 years ago
configJs: {
src: ['demo/version.js'],
dest: 'dist/config.js'
},
8 years ago
demoJs: {
7 years ago
src: ['demo/app.js', 'demo/js/**/*.js',' demo/config.js'],
7 years ago
dest: 'dist/demo.js'
8 years ago
},
demoCss: {
src: ['demo/css/**/*.css'],
7 years ago
dest: 'dist/demo.css'
8 years ago
},
bi_polyfillJs: {
src: ['src/polyfill/**/*.js'],
dest: 'bi/polyfill.js'
},
8 years ago
bi_coreJs: {
src: [
7 years ago
'src/core/jquery.js',
'src/core/underscore.js',
8 years ago
'src/core/foundation.js',
7 years ago
// 'src/core/mvc/**/*.js',
8 years ago
'src/core/base.js',
'src/core/ob.js',
'src/core/widget.js',
7 years ago
// 'src/core/model.js',
// 'src/core/view.js',
8 years ago
'src/core/shortcut.js',
7 years ago
'src/core/utils/*.js',
8 years ago
'src/core/behavior/behavior.js',
'src/core/wrapper/layout.js',
7 years ago
'src/core/**/*.js',
8 years ago
'src/data/data.js',
'src/data/**/*.js',
'src/config.js'
],
dest: 'bi/core.js'
},
//最基础的控件
bi_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',
'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',
8 years ago
'src/base/tree/asynctree.js',
8 years ago
'src/base/tree/parttree.js',
'src/base/**/*.js'
],
dest: 'bi/base.js'
},
//实现好的一些基础实例
bi_caseJs: {
src: [
'src/case/combo/popup.bubble.js',
'src/case/**/*.js'
],
dest: 'bi/case.js'
},
bi_widgetJs: {
src: [
'src/widget/paramsettingcombo/popup.param.js',
'src/widget/sequencetable/treenumber.sequencetable.js',
'src/widget/**/*.js',
'src/component/**/*.js'
],
7 years ago
dest: 'bi/widget.js'
8 years ago
},
8 years ago
bi_chartJs: {
src: [
'src/addons/chart/chart.js',
'src/addons/chart/chart.combine.js',
'src/addons/chart/factory.charts.js',
'src/addons/chart/**/*.js'
],
7 years ago
dest: 'bi/chart.js'
},
bi_sliderJs: {
7 years ago
src: [
7 years ago
'src/addons/sliders/js/**/*.js'
7 years ago
],
7 years ago
dest: 'bi/sliders.js'
7 years ago
},
7 years ago
bi_sliderCss: {
src: [
7 years ago
'src/addons/sliders/**/*.css'
7 years ago
],
7 years ago
dest: 'bi/sliders.css'
7 years ago
},
7 years ago
bi_jqueryuiJs: {
7 years ago
src: [
7 years ago
'src/addons/sliders/lib/jquery.ui.core.js',
'src/addons/sliders/lib/jquery.ui.core.js',
'src/addons/sliders/lib/jquery.ui.widget.js',
'src/addons/sliders/lib/jquery.ui.mouse.js',
'src/addons/sliders/lib/jquery.ui.position.js',
'src/addons/sliders/lib/jquery.ui.resizable.js',
'src/addons/sliders/lib/jquery.ui.draggable.js',
'src/addons/sliders/lib/jquery.ui.droppable.js',
'src/addons/sliders/lib/jquery.ui.sortable.js'
7 years ago
],
7 years ago
dest: 'bi/jqueryui.js'
8 years ago
},
8 years ago
bi_coreCss: {
8 years ago
src: ['src/css/core/**/*.css', 'src/css/theme/**/*.css'],
8 years ago
dest: 'bi/core.css'
},
bi_baseCss: {
src: ['src/css/base/**/*.css'],
dest: 'bi/base.css'
},
bi_widgetCss: {
src: ['src/css/widget/**/*.css'],
dest: 'bi/widget.css'
8 years ago
}
},
8 years ago
less: {
7 years ago
sliders: {
expand: true,
cwd: 'src/addons/sliders/less',
src: ['**/*.less'],
dest: 'src/addons/sliders/css/',
ext: '.css'
},
demo: {
8 years ago
expand: true,
cwd: 'demo/less',
src: ['**/*.less'],
dest: 'demo/css/',
ext: '.css'
},
dev: {
options: {
compress: true,
yuicompress: false
}
}
},
7 years ago
uglify: {
8 years ago
options: {
7 years ago
banner: '/*! <%= pkg.name %> */\n'
8 years ago
},
dist: {
files: {
7 years ago
'dist/bundle.min.js': ['<%= concat.bundleJs.dest %>'],
8 years ago
}
}
},
cssmin: {
7 years ago
bundleCss: {
8 years ago
7 years ago
src: '<%= concat.bundleCss.dest %>',
8 years ago
7 years ago
dest: 'dist/bundle.min.css'
8 years ago
},
},
jshint: {
files: ['Gruntfile.js', 'src/**/*.js'],
options: {
globals: {
jQuery: true,
console: true,
module: true,
document: true
}
}
},
watch: {
scripts: {
7 years ago
files: ['src/**/*.js', 'demo/js/**/*.js', 'demo/version.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');
7 years ago
grunt.registerTask('default', ['less', 'concat', 'watch']);
7 years ago
grunt.registerTask('min', ['less', 'concat', 'uglify', 'cssmin']);
8 years ago
};