0.5.6 • Published 7 years ago

dbl2 v0.5.6

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

dbl2

Generate basic webpack configs for project.And,create a local server with connect,so you can mock data for you xhr. When you run dbl deploy,it will build project to build directory.Then you can push it to the git repo.

安装

$ npm install -g dbl2

使用方式

Usage: dbl [options] [dir]

Options:

  -V, --version        output the version number
  -h, --help           output usage information

初始化:

Usage: dbl init 

Description: init project with scaffold 

安装依赖:

npm install

启动服务:

Usage: dbl server [options] [dir]

Options:
  -p, --port <port>    specify the port [3000]

Description: After run this command, you can input http://localhost:8001 in the address bar.

打包:

Usage: dbl  deploy [options] [dir]

Description: command will build the project form src to build,and push the build directory to the repo with username and password.

Options:
  -u, --username <username>    specify the username of the gitlab
  -P, --password <password>    specify the password of the gitlab

Examples

  • mkdir demo && cd demo
  • dbl init
  • dbl serve
  • dbl deploy

更新记录:

0.5.6

  1. 模板相关:添加 vue 及 vue-loader

0.5.4

  1. 模板相关:去掉 ejs-loader,添加 babel-loader 支持,升级 css-loader

0.5.3

  1. 起始的目录页面不再依赖 index.html 中的 script 跳转,现在 index.html 可以在项目中随意使用或者删除了
  2. 可以在配置文件 make-webpack-config 中通过配置自定义起始页

0.5.2

  1. 启动服务及打包时,当检测到html文件对应的入口js文件不存在时,会自动创建了。

0.5.1

  1. 修复了上次更改导致html中单引号会引起编译异常的bug

0.5.0

  1. 解决了img标签src需要由js赋值的问题,现在可以直接在html中写img标签的src
  2. 在js中require加载html代码时,可以用html-withimg-loader处理图片问题
  3. 入口html不再使用handlebars模版处理,仍然提供加载子页面功能,不过语法更改为:#include("./xxx/xxx.html")
  4. 由于部分页面不需要任何js,提供一项黑科技避免自动生成script标签:head中添加一个

0.3.0

  1. 页面调试目录转移到虚拟目录/build/,比如demo. html对应的地址变为http://127.0.0.1:3001/build/demo.html,index. html中生成的目录已做相应更改
  2. 入口html页面将被handlebars-loader热处理,意味着可以使用{{> ./ handlebars/layout.hbs}}语法提取页面公共部分,参见demo.html
  3. 页面公共header项提取为layout.hbs,公共js提取为scripts.hbs,不再需要根据html名更改script的src,会自动生成。参见demo.html
  4. mock时接口后缀默认是. json,但启动服务时支持设置其他后缀,方法示例:dbl server -s .htm
  5. handlebars模版文件后缀可以简写为.hbs,handlebars-loader会处理,原. handlebars仍然可以使用

0.2.0

  1. 注意publicPath配置处,有各环境的发布路径,请根据需要切换

0.1.4

  1. index.html中生成的页面链接后加上了页面title,方便查看

License

(The MIT License)

Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.