wxmagic-cli
Advanced tools
+1
-1
@@ -13,3 +13,3 @@ /** | ||
| const download = require('download-github-repo'); | ||
| require('devmsg/wxmagic'); | ||
| require('shelljs/global'); | ||
@@ -16,0 +16,0 @@ function create(name, options) { |
+0
-48
@@ -53,8 +53,2 @@ /** | ||
| return; | ||
| case 'redux': | ||
| require('./generate-redux')(name, options); | ||
| return; | ||
| case 'saga': | ||
| require('./generate-saga')(name, options); | ||
| return; | ||
| } | ||
@@ -81,12 +75,2 @@ console.log('Unknown type to generate'); | ||
| .action((options) => { | ||
| if (!options.minify) { | ||
| if (options.ignoreMinifyJs) { | ||
| console.error('--ignore-minify-js 必须配合 --minify 选项一起使用'); | ||
| process.exit(); | ||
| } | ||
| if (options.ignoreMinifyPage) { | ||
| console.error('--ignore-minify-page 必须配合 --minify 选项一起使用'); | ||
| process.exit(); | ||
| } | ||
| } | ||
| require('./build')(options); | ||
@@ -111,36 +95,4 @@ }); | ||
| program | ||
| .command('minify-page') | ||
| .description('minify page') | ||
| .option('--work-dir [dir]', '工作目录,默认为当前目录') | ||
| .option('--config [file]', '配置文件,默认为.labrador') | ||
| .option('--src-dir [dir]', '源码目录,默认为工作目录下的src文件夹') | ||
| .option('--dist-dir [dir]', '目标目录,默认为工作目录下的dist文件夹') | ||
| .option('--modules-dir [dir]', 'NPM模块目录,默认为工作目录下的node_modules文件夹') | ||
| .option('--temp-dir [dir]', '临时目录,默认为工作目录下的.build文件夹') | ||
| .action((options) => { | ||
| require('./utils'); | ||
| require('./config')(options); | ||
| let minifyPage = require('./minify-page'); | ||
| co(minifyPage).then(() => console.log('done'), (error) => console.error(error)); | ||
| }); | ||
| program | ||
| .command('minify-js') | ||
| .description('minify js') | ||
| .option('--work-dir [dir]', '工作目录,默认为当前目录') | ||
| .option('--config [file]', '配置文件,默认为.labrador') | ||
| .option('--src-dir [dir]', '源码目录,默认为工作目录下的src文件夹') | ||
| .option('--dist-dir [dir]', '目标目录,默认为工作目录下的dist文件夹') | ||
| .option('--modules-dir [dir]', 'NPM模块目录,默认为工作目录下的node_modules文件夹') | ||
| .option('--temp-dir [dir]', '临时目录,默认为工作目录下的.build文件夹') | ||
| .action((options) => { | ||
| require('./utils'); | ||
| require('./config')(options); | ||
| let minifyJs = require('./minify-js'); | ||
| co(minifyJs).then(() => console.log('done'), (error) => console.error(error)); | ||
| }); | ||
| program.parse(process.argv); | ||
| if (!program.args.length) program.help(); |
+2
-4
| { | ||
| "name": "wxmagic-cli", | ||
| "version": "0.1.1", | ||
| "version": "0.1.2", | ||
| "description": "小程序手脚架", | ||
| "main": "index.js", | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| }, | ||
| "scripts": {}, | ||
| "bin": { | ||
@@ -10,0 +8,0 @@ "wxmagic": "bin/wxmagic" |
52131
-3.97%1601
-2.79%