gulp-qap
[qap](http://open.taobao.com/docs/doc.htm?treeId=260&articleId=105545&docType=1)项目的gulp插件,替换[qap-cli](https://www.npmjs.com/package/qap-cli)。
Last updated 2 years ago by qianniu .
ISC · Original npm · Tarball · package.json
$ cnpm install gulp-qap 
SYNC missed versions from official npm registry.

qap项目的gulp插件,替换qap-cli

特性

  • [x] 自动升级
  • [x] 检测jssdk
  • [x] 调试
  • [x] 打包

打包

gulp.task('package', function(cb){
    var zip = require('gulp-rax-qap').package({
        qapJson:'./qap.json',//必须
        // update:true,
        // jssdk:{
        //     version:'stable',//defaul beta|stable
        //     update:true}//是否每次debug/package都检测sdk升级
        }).zip;
    gulp.src('build/**/*.js')
        .pipe(zip('package.zip'))
        .pipe(gulp.dest('_output'));
});

调试

用法

gulp.task('debug', function(cb) {
    var debugServer = require('gulp-rax-qap').devtool;
    debugServer({
        webpack: require('webpack.config.js') //必须字段
    }, cb);
});

详细参数

{
    ip: '30.*', //调试所用的IP,支持正则表达式,默认使用检测到的第一个ip
    port: 8088, //调试端口,default 8088
    fileServerPort: 8080,//文件映射端口,方便客户端获取qap.json
    verbose: true, //是否输出普通日志,default false
    webpack: require('webpack.config.js'), //必须字段,
    jssdk: {
        version: 'stable', //defaul beta|stable
        update: true //是否每次debug/package都检测sdk升级,否则只会每天数次运行检测更新
    },
    webpackDevServerConfig: {//webpack启动参数,参考:https://webpack.github.io/docs/webpack-dev-server.html
        hot: false,//default false
        inline: true,//default true
        quiet: true,//default quiet
        publicPath: webpack.output.publicPath,
        headers: { 'Access-Control-Allow-Origin': '*' },
        contentBase: path.resolve(process.cwd(), './')
    }, //overwrite defualt
    openUrl: ['h5', 'debug', 'page'] //打开的页面,h5(h5版本) | debug(调试页面) | page(单个js页面),默认打开三个
}

打包

to be continued...

Current Tags

  • 0.0.3                                ...           latest (2 years ago)
  • 0.0.8                                ...           stable (2 years ago)

8 Versions

  • 0.0.8                                ...           2 years ago
  • 0.0.7                                ...           2 years ago
  • 0.0.6                                ...           2 years ago
  • 0.0.5                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 8
Last Day 0
Last Week 0
Last Month 19
Dependencies (40)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2018 © taobao.org |