|
|
@ -2,172 +2,180 @@ module.exports = function (grunt) { |
|
|
|
|
|
|
|
|
|
|
|
// Project configuration.
|
|
|
|
// Project configuration.
|
|
|
|
grunt.initConfig({ |
|
|
|
grunt.initConfig({ |
|
|
|
pkg: grunt.file.readJSON('package.json'), |
|
|
|
pkg: grunt.file.readJSON("package.json"), |
|
|
|
concat: { |
|
|
|
concat: { |
|
|
|
options: { |
|
|
|
options: { |
|
|
|
separator: '' |
|
|
|
separator: "" |
|
|
|
}, |
|
|
|
}, |
|
|
|
polyfillJs: { |
|
|
|
polyfillJs: { |
|
|
|
src: ['src/polyfill/**/*.js'], |
|
|
|
src: ["src/polyfill/**/*.js"], |
|
|
|
dest: 'dist/polyfill.js' |
|
|
|
dest: "dist/polyfill.js" |
|
|
|
}, |
|
|
|
}, |
|
|
|
coreJs: { |
|
|
|
coreJs: { |
|
|
|
src: [ |
|
|
|
src: [ |
|
|
|
'src/core/jquery.js', |
|
|
|
"src/core/jquery.js", |
|
|
|
'src/core/underscore.js', |
|
|
|
"src/core/underscore.js", |
|
|
|
'src/core/foundation.js', |
|
|
|
"src/core/foundation.js", |
|
|
|
// 'src/core/mvc/**/*.js',
|
|
|
|
// 'src/core/mvc/**/*.js',
|
|
|
|
'src/core/base.js', |
|
|
|
"src/core/base.js", |
|
|
|
'src/core/ob.js', |
|
|
|
"src/core/ob.js", |
|
|
|
'src/core/widget.js', |
|
|
|
"src/core/widget.js", |
|
|
|
// 'src/core/model.js',
|
|
|
|
// 'src/core/model.js',
|
|
|
|
// 'src/core/view.js',
|
|
|
|
// 'src/core/view.js',
|
|
|
|
'src/core/shortcut.js', |
|
|
|
"src/core/shortcut.js", |
|
|
|
'src/core/utils/*.js', |
|
|
|
"src/core/utils/*.js", |
|
|
|
'src/core/behavior/behavior.js', |
|
|
|
"src/core/behavior/behavior.js", |
|
|
|
'src/core/wrapper/layout.js', |
|
|
|
"src/core/wrapper/layout.js", |
|
|
|
'src/core/**/*.js', |
|
|
|
"src/core/**/*.js", |
|
|
|
|
|
|
|
|
|
|
|
'src/data/data.js', |
|
|
|
"src/data/data.js", |
|
|
|
'src/data/**/*.js' |
|
|
|
"src/data/**/*.js" |
|
|
|
], |
|
|
|
], |
|
|
|
dest: 'dist/core.js' |
|
|
|
dest: "dist/core.js" |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//最基础的控件
|
|
|
|
//最基础的控件
|
|
|
|
baseJs: { |
|
|
|
baseJs: { |
|
|
|
src: [ |
|
|
|
src: [ |
|
|
|
'src/third/**/*.js', |
|
|
|
"src/third/**/*.js", |
|
|
|
'src/base/formula/config.js', |
|
|
|
"src/base/formula/config.js", |
|
|
|
'src/base/pane.js', |
|
|
|
"src/base/pane.js", |
|
|
|
'src/base/single/single.js', |
|
|
|
"src/base/single/single.js", |
|
|
|
'src/base/single/text.js', |
|
|
|
"src/base/single/text.js", |
|
|
|
'src/base/single/button/button.basic.js', |
|
|
|
"src/base/single/button/button.basic.js", |
|
|
|
'src/base/single/button/button.node.js', |
|
|
|
"src/base/single/button/button.node.js", |
|
|
|
'src/base/single/tip/tip.js', |
|
|
|
"src/base/single/tip/tip.js", |
|
|
|
'src/base/combination/group.button.js', |
|
|
|
"src/base/combination/group.button.js", |
|
|
|
'src/base/combination/tree.button.js', |
|
|
|
"src/base/combination/tree.button.js", |
|
|
|
'src/base/combination/map.button.js', |
|
|
|
"src/base/combination/map.button.js", |
|
|
|
'src/base/tree/treeview.js', |
|
|
|
"src/base/tree/treeview.js", |
|
|
|
'src/base/tree/asynctree.js', |
|
|
|
"src/base/tree/asynctree.js", |
|
|
|
'src/base/tree/parttree.js', |
|
|
|
"src/base/tree/parttree.js", |
|
|
|
'src/base/**/*.js' |
|
|
|
"src/base/**/*.js" |
|
|
|
], |
|
|
|
], |
|
|
|
dest: 'dist/base.js' |
|
|
|
dest: "dist/base.js" |
|
|
|
}, |
|
|
|
}, |
|
|
|
//实现好的一些基础实例
|
|
|
|
//实现好的一些基础实例
|
|
|
|
caseJs: { |
|
|
|
caseJs: { |
|
|
|
src: [ |
|
|
|
src: [ |
|
|
|
'src/case/combo/popup.bubble.js', |
|
|
|
"src/case/combo/popup.bubble.js", |
|
|
|
'src/case/**/*.js' |
|
|
|
"src/case/**/*.js" |
|
|
|
], |
|
|
|
], |
|
|
|
dest: 'dist/case.js' |
|
|
|
dest: "dist/case.js" |
|
|
|
}, |
|
|
|
}, |
|
|
|
widgetJs: { |
|
|
|
widgetJs: { |
|
|
|
src: [ |
|
|
|
src: [ |
|
|
|
'src/widget/paramsettingcombo/popup.param.js', |
|
|
|
"src/widget/paramsettingcombo/popup.param.js", |
|
|
|
'src/widget/sequencetable/treenumber.sequencetable.js', |
|
|
|
"src/widget/sequencetable/treenumber.sequencetable.js", |
|
|
|
'src/widget/**/*.js', |
|
|
|
"src/widget/**/*.js", |
|
|
|
'src/component/**/*.js' |
|
|
|
"src/component/**/*.js" |
|
|
|
], |
|
|
|
], |
|
|
|
dest: 'dist/widget.js' |
|
|
|
dest: "dist/widget.js" |
|
|
|
}, |
|
|
|
}, |
|
|
|
routerJs: { |
|
|
|
routerJs: { |
|
|
|
src: [ |
|
|
|
src: [ |
|
|
|
'src/router/**/*.js' |
|
|
|
"src/router/**/*.js" |
|
|
|
], |
|
|
|
], |
|
|
|
dest: 'dist/router.js' |
|
|
|
dest: "dist/router.js" |
|
|
|
}, |
|
|
|
}, |
|
|
|
chartJs: { |
|
|
|
chartJs: { |
|
|
|
src: [ |
|
|
|
src: [ |
|
|
|
'src/addons/chart/chart.js', |
|
|
|
"src/addons/chart/chart.js", |
|
|
|
'src/addons/chart/chart.combine.js', |
|
|
|
"src/addons/chart/chart.combine.js", |
|
|
|
'src/addons/chart/factory.charts.js', |
|
|
|
"src/addons/chart/factory.charts.js", |
|
|
|
'src/addons/chart/**/*.js' |
|
|
|
"src/addons/chart/**/*.js" |
|
|
|
], |
|
|
|
], |
|
|
|
dest: 'dist/chart.js' |
|
|
|
dest: "dist/chart.js" |
|
|
|
}, |
|
|
|
}, |
|
|
|
coreCss: { |
|
|
|
coreCss: { |
|
|
|
src: ['src/css/core/**/*.css', 'src/css/theme/**/*.css'], |
|
|
|
src: ["src/css/core/**/*.css", "src/css/theme/**/*.css"], |
|
|
|
dest: 'dist/core.css' |
|
|
|
dest: "dist/core.css" |
|
|
|
}, |
|
|
|
}, |
|
|
|
coreWithoutNormalizeCss: { |
|
|
|
coreWithoutNormalizeCss: { |
|
|
|
src: ['src/css/core/**/*.css', 'src/css/theme/**/*.css', '!src/css/core/normalize.css','!src/css/core/normalize2.css'], |
|
|
|
src: ["src/css/core/**/*.css", "src/css/theme/**/*.css", "!src/css/core/normalize.css", "!src/css/core/normalize2.css"], |
|
|
|
dest: 'dist/core_without_normalize.css' |
|
|
|
dest: "dist/core_without_normalize.css" |
|
|
|
}, |
|
|
|
}, |
|
|
|
baseCss: { |
|
|
|
baseCss: { |
|
|
|
src: ['src/css/base/**/*.css'], |
|
|
|
src: ["src/css/base/**/*.css"], |
|
|
|
dest: 'dist/base.css' |
|
|
|
dest: "dist/base.css" |
|
|
|
}, |
|
|
|
}, |
|
|
|
widgetCss: { |
|
|
|
widgetCss: { |
|
|
|
src: ['src/css/widget/**/*.css'], |
|
|
|
src: ["src/css/widget/**/*.css"], |
|
|
|
dest: 'dist/widget.css' |
|
|
|
dest: "dist/widget.css" |
|
|
|
}, |
|
|
|
}, |
|
|
|
resourceCss: { |
|
|
|
resourceCss: { |
|
|
|
src: ['src/css/resource/**/*.css'], |
|
|
|
src: ["src/css/resource/**/*.css"], |
|
|
|
dest: 'dist/resource.css' |
|
|
|
dest: "dist/resource.css" |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
publicBundleJs: { |
|
|
|
publicBundleJs: { |
|
|
|
src: ['public/js/**/*.js', 'public/js/index.js'], |
|
|
|
src: ["public/js/**/*.js", "public/js/index.js"], |
|
|
|
dest: 'public/bundle.js' |
|
|
|
dest: "public/bundle.js" |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
bundleJs: { |
|
|
|
bundleJs: { |
|
|
|
src: ['dist/core.js', 'dist/base.js', 'dist/case.js', 'dist/widget.js', 'dist/router.js', 'public/js/**/*.js', 'public/js/index.js'], |
|
|
|
src: ["dist/core.js", "dist/base.js", "dist/case.js", "dist/widget.js", "dist/router.js", "public/js/**/*.js", "public/js/index.js"], |
|
|
|
dest: 'dist/bundle.js' |
|
|
|
dest: "dist/bundle.js" |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
publicBundleCss: { |
|
|
|
publicBundleCss: { |
|
|
|
src: ['public/css/app.css', 'public/css/**/*.css'], |
|
|
|
src: ["public/css/app.css", "public/css/**/*.css"], |
|
|
|
dest: 'public/bundle.css' |
|
|
|
dest: "public/bundle.css" |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
bundleCss: { |
|
|
|
bundleCss: { |
|
|
|
src: ['dist/core.css', 'dist/base.css', 'dist/widget.css', 'public/css/app.css', 'public/css/**/*.css'], |
|
|
|
src: ["dist/core.css", "dist/base.css", "dist/widget.css", "public/css/app.css", "public/css/**/*.css"], |
|
|
|
dest: 'dist/bundle.css' |
|
|
|
dest: "dist/bundle.css" |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
configJs: { |
|
|
|
configJs: { |
|
|
|
src: ['demo/version.js'], |
|
|
|
src: ["demo/version.js"], |
|
|
|
dest: 'dist/config.js' |
|
|
|
dest: "dist/config.js" |
|
|
|
}, |
|
|
|
}, |
|
|
|
demoJs: { |
|
|
|
demoJs: { |
|
|
|
src: ['demo/app.js', 'demo/js/**/*.js', ' demo/config.js'], |
|
|
|
src: ["demo/app.js", "demo/js/**/*.js", " demo/config.js"], |
|
|
|
dest: 'dist/demo.js' |
|
|
|
dest: "dist/demo.js" |
|
|
|
}, |
|
|
|
}, |
|
|
|
demoCss: { |
|
|
|
demoCss: { |
|
|
|
src: ['demo/css/**/*.css'], |
|
|
|
src: ["demo/css/**/*.css"], |
|
|
|
dest: 'dist/demo.css' |
|
|
|
dest: "dist/demo.css" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
fineuiJs: { |
|
|
|
|
|
|
|
src: ["dist/core.js", "dist/fix/fix.js", "dist/fix/fix.compact.js", "dist/base.js", "dist/case.js", "dist/widget.js"], |
|
|
|
|
|
|
|
dest: "dist/fineui.js" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
fineuiCss: { |
|
|
|
|
|
|
|
src: ["dist/core.css", "dist/base.css", "dist/widget.css"], |
|
|
|
|
|
|
|
dest: "dist/fineui.css" |
|
|
|
}, |
|
|
|
}, |
|
|
|
utilsJs: { |
|
|
|
utilsJs: { |
|
|
|
src: [ |
|
|
|
src: [ |
|
|
|
'src/core/underscore.js', |
|
|
|
"src/core/underscore.js", |
|
|
|
'src/core/foundation.js', |
|
|
|
"src/core/foundation.js", |
|
|
|
'src/core/var.js', |
|
|
|
"src/core/var.js", |
|
|
|
'src/core/proto/array.js', |
|
|
|
"src/core/proto/array.js", |
|
|
|
'src/core/proto/number.js', |
|
|
|
"src/core/proto/number.js", |
|
|
|
'src/core/proto/string.js', |
|
|
|
"src/core/proto/string.js", |
|
|
|
'src/core/base.js', |
|
|
|
"src/core/base.js", |
|
|
|
'src/core/ob.js', |
|
|
|
"src/core/ob.js", |
|
|
|
'src/core/alias.js', |
|
|
|
"src/core/alias.js", |
|
|
|
'src/core/inject.js', |
|
|
|
"src/core/inject.js", |
|
|
|
'src/core/utils/*.js', |
|
|
|
"src/core/utils/*.js", |
|
|
|
|
|
|
|
|
|
|
|
'src/data/data.js', |
|
|
|
"src/data/data.js", |
|
|
|
'src/data/**/*.js' |
|
|
|
"src/data/**/*.js" |
|
|
|
], |
|
|
|
], |
|
|
|
dest: 'utils/utils.js' |
|
|
|
dest: "utils/utils.js" |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
less: { |
|
|
|
less: { |
|
|
|
demo: { |
|
|
|
demo: { |
|
|
|
expand: true, |
|
|
|
expand: true, |
|
|
|
cwd: 'demo/less', |
|
|
|
cwd: "demo/less", |
|
|
|
src: ['**/*.less'], |
|
|
|
src: ["**/*.less"], |
|
|
|
dest: 'demo/css/', |
|
|
|
dest: "demo/css/", |
|
|
|
ext: '.css' |
|
|
|
ext: ".css" |
|
|
|
}, |
|
|
|
}, |
|
|
|
main: { |
|
|
|
main: { |
|
|
|
expand: true, |
|
|
|
expand: true, |
|
|
@ -186,11 +194,12 @@ module.exports = function (grunt) { |
|
|
|
|
|
|
|
|
|
|
|
uglify: { |
|
|
|
uglify: { |
|
|
|
options: { |
|
|
|
options: { |
|
|
|
banner: '/*! <%= pkg.name %> */\n' |
|
|
|
banner: "/*! <%= pkg.name %> */\n" |
|
|
|
}, |
|
|
|
}, |
|
|
|
dist: { |
|
|
|
dist: { |
|
|
|
files: { |
|
|
|
files: { |
|
|
|
'dist/bundle.min.js': ['<%= concat.bundleJs.dest %>'], |
|
|
|
"dist/bundle.min.js": ["<%= concat.bundleJs.dest %>"], |
|
|
|
|
|
|
|
"dist/fineui.min.js": ["<%= concat.fineuiJs.dest %>"] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -199,15 +208,22 @@ module.exports = function (grunt) { |
|
|
|
|
|
|
|
|
|
|
|
bundleCss: { |
|
|
|
bundleCss: { |
|
|
|
|
|
|
|
|
|
|
|
src: '<%= concat.bundleCss.dest %>', |
|
|
|
src: "<%= concat.bundleCss.dest %>", |
|
|
|
|
|
|
|
|
|
|
|
dest: 'dist/bundle.min.css' |
|
|
|
dest: "dist/bundle.min.css" |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
fineuiCss: { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src: "<%= concat.fineuiCss.dest %>", |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dest: "dist/fineui.min.css" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
jshint: { |
|
|
|
jshint: { |
|
|
|
files: ['Gruntfile.js', 'src/**/*.js'], |
|
|
|
files: ["Gruntfile.js", "src/**/*.js"], |
|
|
|
options: { |
|
|
|
options: { |
|
|
|
globals: { |
|
|
|
globals: { |
|
|
|
jQuery: true, |
|
|
|
jQuery: true, |
|
|
@ -219,8 +235,8 @@ module.exports = function (grunt) { |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
scripts: { |
|
|
|
scripts: { |
|
|
|
files: ['src/**/*.js', 'demo/js/**/*.js', 'demo/version.js', 'demo/config.js', 'demo/less/**/*.less'], |
|
|
|
files: ["src/**/*.js", "demo/js/**/*.js", "demo/version.js", "demo/config.js", "demo/less/**/*.less"], |
|
|
|
tasks: ['less', 'concat'], |
|
|
|
tasks: ["less", "concat"], |
|
|
|
options: { |
|
|
|
options: { |
|
|
|
spanw: true, |
|
|
|
spanw: true, |
|
|
|
interrupt: true |
|
|
|
interrupt: true |
|
|
@ -229,13 +245,13 @@ module.exports = function (grunt) { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify'); |
|
|
|
grunt.loadNpmTasks("grunt-contrib-uglify"); |
|
|
|
grunt.loadNpmTasks('grunt-contrib-jshint'); |
|
|
|
grunt.loadNpmTasks("grunt-contrib-jshint"); |
|
|
|
grunt.loadNpmTasks('grunt-contrib-less'); |
|
|
|
grunt.loadNpmTasks("grunt-contrib-less"); |
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch'); |
|
|
|
grunt.loadNpmTasks("grunt-contrib-watch"); |
|
|
|
grunt.loadNpmTasks('grunt-contrib-concat'); |
|
|
|
grunt.loadNpmTasks("grunt-contrib-concat"); |
|
|
|
grunt.loadNpmTasks('grunt-contrib-cssmin'); |
|
|
|
grunt.loadNpmTasks("grunt-contrib-cssmin"); |
|
|
|
|
|
|
|
|
|
|
|
grunt.registerTask('default', ['less', 'concat', 'watch']); |
|
|
|
grunt.registerTask("default", ["less", "concat", "watch"]); |
|
|
|
grunt.registerTask('min', ['less', 'concat', 'uglify', 'cssmin']); |
|
|
|
grunt.registerTask("min", ["less", "concat", "uglify", "cssmin"]); |
|
|
|
}; |
|
|
|
}; |