Commit b148ab29 authored by Jinqn's avatar Jinqn

修改grunt

parent ac692324
......@@ -20,7 +20,8 @@ module.exports = function ( grunt ) {
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n' +
' * ====================================================\n' +
' */\n\n',
buildPath = 'dev/import.php';
buildPath = 'dev/import.php',
distPath = 'dist/';
var getPath = function ( readFile ) {
......@@ -43,7 +44,6 @@ module.exports = function ( grunt ) {
pkg: grunt.file.readJSON( 'package.json' ),
concat: {
js: {
options: {
banner: banner + '(function(kity, window) {\n\n',
......@@ -53,11 +53,9 @@ module.exports = function ( grunt ) {
}
},
src: getPath( buildPath ),
dest: 'dist/kityminder.all.js'
dest: distPath + 'kityminder.all.js'
}
},
uglify: {
minimize: {
options: {
......@@ -68,6 +66,26 @@ module.exports = function ( grunt ) {
}
}
},
copy: {
dir: {
files: [
{
src: [ 'dialogs/**', 'lang/**', 'lib/**', 'social/**', 'themes/**' ],
dest: distPath
}
]
}
},
replace: {
online: {
src: distPath+'index.html',
overwrite: true,
replacements: [ {
from: /1234567890/ig,
to: '1234567890'
}]
}
},
/* Start [Task liverload] ------------------------------------*/
livereload: {
......@@ -103,8 +121,10 @@ module.exports = function ( grunt ) {
/* [Build plugin & task ] ------------------------------------*/
grunt.loadNpmTasks( 'grunt-contrib-concat' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-text-replace');
// Build task(s).
grunt.registerTask( 'default', [ 'concat:js', 'uglify:minimize' ] );
grunt.registerTask( 'default', [ 'concat', 'uglify', 'copy', 'replace' ] );
/* [liverload plugin & task ] ------------------------------------*/
grunt.loadNpmTasks( 'grunt-regarde' );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment