ttpai

0.1.21 • Public • Published

ttpai

天天拍车前端集成工具

  • 1.安装
sudo npm install -g ttpai
  • 2.在项目根目录建立key.js文件(主要用于远程主机ssh登录的密码端口等)
module.exports = {
    "server": {
        "100": {
            "declare": "test",
            "host": "192.168.0.100",
            "port": 2208,
            "username": "root",
            "password": "123456"
        }
    },
    "tinifyKey": []
}

  • 3.创建一个 webpack 项目(或者创建一个空项目 ttp -p projectname)
ttpai -p 2015.ttpai.cn h5|pc|boss
  |--news
  |----pages
  |------2015.ttpai.cn
  |--------common
  |----------fonts
  |----------images
  |----------js
  |----------less
  |--------components
  |--------data
  |--------dialog
  |--------modules
  |----------meta
  |------------meta.hbs
  |--------src
  |----------entry
  |------------index.js
  |----------html
  |----------images
  |----------less
  |------------index.less
  |----------temp
  |------------index.hbs
  |--------.eslintrc
  |--------gulpfile.js
  |--------webpack.config.dist.js
  |--------webpack.config.js
  
  • 4.项目发布命令:ttpai -r|-release(登录远程主机并切换git仓库)
#开发环境发布命令
ttpai -r 151 dev
ttpai -release 151 dev
 
#测试/模拟环境发布命令
ttpai -r 91 test
 
#灰度环境发布命令
ttpai -r 82 release
  • 5.登录远程主机执行上线部署任务
#已废弃,目前前端上线由运维控制
ttpai -d
ttpai -deploy
  • 6.使用'ttpai'工具编译 webpack 项目
#webpack 等价于以下命令
ttpai -b
ttpai -b dev
ttpai -b dev all
ttpai -build
 
#webpack -w  等价于以下命令
ttpai -b -w
ttpai -b dev -w
ttpai -b dev all -w
 
#webpack --config webpack.config.dist.js  等价于以下命令
ttpai -b dist
ttpai -b dist all
 
#webpack --config webpack.config.dist.js -w  等价于以下命令
ttpai -b dist -w
ttpai -b dist all -w
 
#编译特定配置文件 data/webpack.config.options.cby.js
ttpai -b cby
ttpai -b dev cby
  
ttpai -b cby -w
ttpai -b dev cby -w
 
ttpai -b dist cby
ttpai -b dist cby -w

#图片压缩功能,默认压缩项目下“./dist/images”和“./common/images”下的所有图片
ttpai -b min_pic

#图片压缩功能,压缩自定义目录下的文件
ttpai -b min_pic ./dist/images

Readme

Keywords

Package Sidebar

Install

npm i ttpai

Weekly Downloads

17

Version

0.1.21

License

MIT

Unpacked Size

78.9 kB

Total Files

22

Last publish

Collaborators

  • bangyao.chen