dev-tool
devTool for 乐居网平台组前端
Last updated 4 years ago by iahu .
ISC · Original npm · Tarball · package.json
$ cnpm install dev-tool 
SYNC missed versions from official npm registry.

THIS IS AN PERSONAL NODE_MODULE. DO NOT USE IT

devTool

devTool for 乐居网平台组前端

说明

提供本地的web前端开发环境。

  1. 静态文件服务 访问静态资源

  2. combo服务 combo可支持在线r.js解析,在线编译less/sass的功能 url示例: /public/a.css;/public/b.css /public/a.js;/public/b.js /public/a.js?r /public/a.less /public/a.sass

  3. 代理服务器服务 提供反向代理,设置本地hosts的功能 配置文件示例:

    {
    	"proxy_port": 1080,
    	"proxy_hosts": [
    		"127.0.0.1 www.test.com dev.com"
    	],
    	"proxy_rules": [
    		// rule: match-url target-server
    		// The latter rule would overwrite the previous rules
    		"http://cdn\\d?.exmaple.com http://11.22.33.44", // #1 remote address
    		"http://cdn(\\d)?.exmaple.com/test/(.+) http://cdn$1.test.com:8080" // #2 local address
    	]
    }
    

上面的配置将把http://cdn.exmaple.com/test/a.js 指向 127.0.0.1:8080, 而http://cdn.exmaple.com/a.js 将指向 11.22.33.44

注: 可以通过在cwd目录下建一个devtool.json来覆盖默认配置,修改本地的配置需要重启devtool才生效。

安装方法

npm i -g dev-tool

使用方法

Usage: devtool [options] directory

Options:

  -h, --help                 output usage information
  -V, --version              output the version number
  -p, --port <port>          static server port
  -c, --combo [true|false]   use combo server
  -s, --static [true|false]  use static server
  -r, --proxy [false|true]   use proxy server
  -o, --proxy_port <port>    proxy server port

todo

  • 支持 mockjson 功能

Current Tags

  • 1.0.2                                ...           beta (4 years ago)
  • 1.0.5                                ...           latest (4 years ago)

6 Versions

  • 1.0.5                                ...           4 years ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1 [deprecated]           ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (11)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |