1 | [![NPM](https://nodei.co/npm/jdfx.png?downloads=true)](https://nodei.co/npm/jdfx/)
|
2 |
|
3 | [![NPM version](https://badge.fury.io/js/jdfx.png)](http://badge.fury.io/js/jdfx) [![Build Status](https://travis-ci.org/jdf2e/jdf.svg?branch=master)](https://travis-ci.org/jdf2e/jdf)
|
4 |
|
5 | ## 关于JDFX
|
6 |
|
7 | JDFX是京东前端团队自主研发的一款自动化构建工具,目的是合理、快速和高效的解决前端开发中的工程和项目问题,核心集成了本地调试、本地构建、远程布署、代码生成等一系列开发命令工具。
|
8 |
|
9 | ## 安装使用
|
10 |
|
11 | * [nodejs@4.4.5到最新LTS版本可用](http://nodejs.org/)
|
12 | ```
|
13 | $ npm install jdfx -g
|
14 | ```
|
15 | * 执行`jdf -V`,测试是否安装成功(注意是大写的`V`)
|
16 |
|
17 | ## 更新日志
|
18 |
|
19 | [完整日志](https://github.com/jdf2e/jdf/blob/master/CHANGELOG.md)
|
20 |
|
21 | ### 3.4.10 / 2018/03/13 16:42:00
|
22 | * [fix] 修复对link进行cdn路径替换时,非css link标签,如`<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">`也会进行cdn替换的bug。
|
23 |
|
24 | ## 说明文档
|
25 | * [示例安装](https://github.com/jdf2e/jdf/blob/master/doc/a_tool_develop.md)
|
26 | * [命令文档](https://github.com/jdf2e/jdf/blob/master/doc/a_tool_command.md)
|
27 | * [配置文档](https://github.com/jdf2e/jdf/blob/master/doc/a_tool_config.md)
|
28 | * [api调用文档](https://github.com/jdf2e/jdf/blob/master/doc/a_tool_api.md)
|
29 | * [css优化策略](https://github.com/jdf2e/jdf/blob/master/doc/core_css_optimize.md)
|
30 | * [css雪碧图](https://github.com/jdf2e/jdf/blob/master/doc/a_tool_csssprite.md)
|
31 | * [smarty模版](https://github.com/jdf2e/jdf/blob/master/doc/core_smarty.md)
|
32 | * [tpl模版](https://github.com/jdf2e/jdf/blob/master/doc/core_tpl.md)
|
33 | * [vm模版](https://github.com/jdf2e/jdf/blob/master/doc/core_vm.md)
|
34 | * [widget说明](https://github.com/jdf2e/jdf/blob/master/doc/core_widget.md)
|
35 | * [widgetOutputName标签](https://github.com/jdf2e/jdf/blob/master/doc/core_widgetoutputname.md)
|
36 | * [插件模块](https://github.com/jdf2e/jdf/blob/master/doc/core_plugin.md)
|
37 |
|
38 | ## 使用攻略
|
39 | * [文件路径拼写说明](https://github.com/jdf2e/jdf/issues/6)
|
40 | * [移动端页面开发](https://github.com/jdf2e/jdf/issues/7)
|
41 |
|
42 | ## 功能介绍
|
43 |
|
44 | #### 跨平台
|
45 | * 完美支持windows、mac、linux三大系统
|
46 |
|
47 | #### 项目构建
|
48 | * 生成标准化的项目文件夹
|
49 | * 支持本地联调,本地编译,测试预览等开发流程
|
50 | * 每个项目拥有独立的配置文件,按选项统一编译
|
51 |
|
52 | #### 模块开发
|
53 | * 可快速方便的对模块进行创建,引用,预览,安装和发布
|
54 | * 通过积累,可形成完全符合自己业务的模块云服务
|
55 | * 支持将vm和smarty模版编译为html
|
56 | * 支持将sass和less编译为css
|
57 | * 支持velocity语法
|
58 | * 支持ES6(需要在jdf项目根目录执行`npm install babel-preset-es2015`,es6文件后缀名为`.babel`)
|
59 |
|
60 | #### 项目输出
|
61 | * 自动将页面中的js、css引用转换成combo请求格式
|
62 | * 自动压缩优化js、css、图片文件
|
63 | * 默认给所有静态资源添加CDN域名
|
64 | * 支持cmd规范,自动提取文件id和dependencies,压缩时保留require关键字
|
65 | * 自动生成css精灵图,并更新background-position属性值
|
66 | * 自动生成base64编码
|
67 | * 自动给css样式添加相应的浏览器前缀
|
68 | * 支持图片生成webp格式,并更新相关css图片链接
|
69 | * 压缩css、js、图片文件,并且可根据当前项目中的文件数量自动决定是否启用多线程进行压缩,当前的数量阀值是`200`
|
70 | * 自动给js,css文件的内容头部添加时间戳,方便查看
|
71 | * 文件编码统一输出为utf8
|
72 |
|
73 | #### 项目联调
|
74 | * 一键上传文件到测试服务器,方便其他同学开发预览
|
75 |
|
76 | #### 本地服务
|
77 | * 支持开启本地服务器,方便调试
|
78 | * 支持本地静态文件预览,内置本地开发调试服务器,以及当前目录浏览
|
79 | * 支持实时监听文件,文件被修改时会自动编译成css,并刷新浏览器
|
80 | * 内置browserSync
|
81 | * [详细文档](https://github.com/jdf2e/jdf/blob/master/doc/a_tool_build.md)
|
82 |
|
83 | #### 辅助工具
|
84 | * 支持html/js/css文件格式化
|
85 | * 支持html/js/css代码压缩
|
86 | * 支持html/js/css文件lint,代码质量检查
|
87 |
|
88 | ## 集成工具
|
89 |
|
90 | * [在本地任意目录开启一个server静态服务器](https://github.com/jdf2e/jdf/blob/master/doc/a_tool_server.md)
|
91 | * [html/js/css文件lint代码质量检查](https://github.com/jdf2e/jdf/blob/master/doc/a_tool_lint.md)
|
92 | * [html/js/css文件格式化](https://github.com/jdf2e/jdf/blob/master/doc/a_tool_format.md)
|
93 | * [csssprite图片合并](https://github.com/jdf2e/jdf/blob/master/doc/a_tool_csssprite.md)
|
94 |
|
95 | ## widget组件
|
96 |
|
97 | * 详情请参考[widget文档](https://github.com/jdf2e/jdf/blob/master/doc/core_widget.md)
|
98 | * [vm模版文档](https://github.com/jdf2e/jdf/blob/master/doc/core_vm.md)
|
99 | * [tpl模版文档](https://github.com/jdf2e/jdf/blob/master/doc/core_tpl.md)
|
100 | * [smarty模版文档](https://github.com/jdf2e/jdf/blob/master/doc/core_smarty.md)
|
101 |
|
102 | ## 编译器插件
|
103 | * [Sublime Text2 插件](https://sublime.wbond.net/packages/Jdf%20-%20Tool)
|
104 |
|