diff --git a/app.js b/app.js index ea55121..27db8b8 100644 --- a/app.js +++ b/app.js @@ -103,7 +103,7 @@ program }); program - .command('build') + .command('pack') .alias('b') .description('打包构建一个已存在的项目') .option('-n, --name [pathName]', '打包构建路径名称') @@ -133,7 +133,7 @@ program inquirer.prompt(promps).then(function (answers) { //console.log('\n',answers) option = Object.assign(answers,option); - //console.log(option); + //console.log(option.name); task.pack(option.name); }) }); diff --git a/src/script/tmodjs/test/hello.js b/src/script/tmodjs/test/hello.js index 0a1f54c..c674bf6 100644 --- a/src/script/tmodjs/test/hello.js +++ b/src/script/tmodjs/test/hello.js @@ -1,8 +1,8 @@ -/*TMODJS:{"version":3,"md5":"82a0633ce39bc9927db661a771415017"}*/ -template('test/hello',function($data,$filename -/**/) { +/*TMODJS:{"version":4,"md5":"f1c57d40af99b4e6b3fb34ac8537557c"}*/ +define(function(require){return require('../template')('test/hello', function($data,$filename +/*``*/) { 'use strict';var $utils=this,$helpers=$utils.$helpers,$escape=$utils.$escape,name=$data.name,$out='';$out+='

hello,'; $out+=$escape(name); $out+='

哈哈哈哈!

'; return new String($out); -}); \ No newline at end of file +});}); \ No newline at end of file diff --git a/task/task.js b/task/task.js index f414475..f2817d5 100644 --- a/task/task.js +++ b/task/task.js @@ -19,6 +19,7 @@ const runSequence = require('run-sequence'); const plumber = require('gulp-plumber'); const notify = require('gulp-notify'); const copy = require('gulp-contrib-copy'); +const chalk = require('chalk'); const util = require('./util'); const watch = require('./watch'); @@ -172,11 +173,13 @@ init = (pathName) => { }); - gulp.task('build', function(callback) { - runSequence('stylus_build', 'swig_build', 'htmlmin_build', 'tmod_build', 'babel_build', 'uglify_build'); + gulp.task('build', function() { + runSequence('stylus_build', 'swig_build', 'htmlmin_build', 'tmod_build', 'babel_build', 'uglify_build',function() { + console.log(chalk.green.bold(pathName + ' 打包完成!')); + }); }); - gulp.task('dev', function(callback) { + gulp.task('dev', function() { runSequence('stylus_build', 'swig_build', 'htmlmin_build', 'tmod_build', 'babel_build', 'server'); }); @@ -223,5 +226,6 @@ exports.dev = (pathName) => { exports.pack = (pathName) => { init(pathName); + //console.log(chalk.green(pathName)); runSequence('build'); } \ No newline at end of file