-
Notifications
You must be signed in to change notification settings - Fork 15
2.快速创建新项目
Furic Zhao edited this page Jan 27, 2018
·
4 revisions
使用FEZ快速创建结构化项目
1. 进入FEZ工程目录执行gulp fezinit --dir=demo-zhj
➜ fez git:(master) l
total 128
drwxr-xr-x 13 furic staff 442B 1 26 09:51 .
drwxr-xr-x 3 furic staff 102B 1 26 09:23 ..
-rw-r--r-- 1 furic staff 648B 1 26 09:23 .babelrc
-rw-r--r-- 1 furic staff 532B 1 26 09:23 .editorconfig
drwxr-xr-x 15 furic staff 510B 1 26 09:23 .fez
drwxr-xr-x 13 furic staff 442B 1 26 09:54 .git
-rwxr-xr-x 1 furic staff 89B 1 26 09:23 .gitignore
-rw-r--r-- 1 furic staff 16K 1 26 09:23 .jshintrc
-rw-r--r-- 1 furic staff 14K 1 26 09:23 README.md
-rwxr-xr-x 1 furic staff 9.5K 1 26 09:23 fez.config.sample.js
-rw-r--r-- 1 furic staff 212B 1 26 09:23 gulpfile.babel.js
drwxr-xr-x 1308 furic staff 43K 1 26 09:54 node_modules
-rw-r--r-- 1 furic staff 3.6K 1 26 09:23 package.json
➜ fez git:(master) gulp fezinit --dir=demo-zhj
[10:04:59] Requiring external module babel-register
[10:05:01] Using gulpfile ~/wwwroot/fez/gulpfile.babel.js
[10:05:01] Starting 'fezinit'...
[10:05:01] Starting 'initProject'...
[10:05:01] Finished 'initProject' after 52 ms
[10:05:01] Finished 'fezinit' after 55 ms
[10:05:01] 创建 demo-zhj 成功
[10:05:01] 创建 demo-zhj/src/lib 成功
[10:05:01] 创建 demo-zhj/src 成功
[10:05:01] 创建 demo-zhj/src/static 成功
[10:05:01] 创建 demo-zhj/src/static/fonts 成功
[10:05:01] 创建 demo-zhj/src/static/images 成功
[10:05:01] 创建 demo-zhj/src/static/styles 成功
[10:05:01] 创建 demo-zhj/src/views 成功
[10:05:01] 创建 demo-zhj/src/views/index 成功
[10:05:01] 创建 demo-zhj/src/views/index/module 成功
[10:05:01] 创建 demo-zhj/src/views/public 成功
[10:05:01] 创建 demo-zhj/src/views/public/module 成功
[10:05:01] 创建 demo-zhj/src/views/public/utils 成功
[10:05:01] 创建 demo-zhj/fez.config.js 成功
[10:05:01] 创建 demo-zhj/bower.json 成功
[10:05:01] 创建 demo-zhj/package.json 成功
[10:05:01] 创建 demo-zhj/shim.js 成功
[10:05:01] 创建 demo-zhj/gulpfile.babel.js 成功
[10:05:01] 创建 demo-zhj/src/views/index/index.html 成功
[10:05:01] 创建 demo-zhj/src/views/index/index.js 成功
[10:05:01] 创建 demo-zhj/src/static/styles/index.less 成功
创建完成后会在FEZ工程目录下生成
demo-zhj
目录
➜ fez git:(master) ✗ l
total 128
drwxr-xr-x 14 furic staff 476B 1 26 10:05 .
drwxr-xr-x 3 furic staff 102B 1 26 09:23 ..
-rw-r--r-- 1 furic staff 648B 1 26 09:23 .babelrc
-rw-r--r-- 1 furic staff 532B 1 26 09:23 .editorconfig
drwxr-xr-x 15 furic staff 510B 1 26 09:23 .fez
drwxr-xr-x 13 furic staff 442B 1 26 10:07 .git
-rwxr-xr-x 1 furic staff 89B 1 26 09:23 .gitignore
-rw-r--r-- 1 furic staff 16K 1 26 09:23 .jshintrc
-rw-r--r-- 1 furic staff 14K 1 26 09:23 README.md
drwxr-xr-x 8 furic staff 272B 1 26 10:05 demo-zhj //项目目录
-rwxr-xr-x 1 furic staff 9.5K 1 26 09:23 fez.config.sample.js
-rw-r--r-- 1 furic staff 212B 1 26 09:23 gulpfile.babel.js
drwxr-xr-x 1308 furic staff 43K 1 26 09:54 node_modules
-rw-r--r-- 1 furic staff 3.6K 1 26 09:23 package.json
➜ demo-zhj git:(master) ✗ tree
.
├── bower.json
├── fez.config.js
├── gulpfile.babel.js
├── package.json
├── shim.js
└── src
├── lib
├── static
│ ├── fonts
│ ├── images
│ └── styles
│ └── index.less
└── views
├── index
│ ├── index.html
│ ├── index.js
│ └── module
└── public
├── module
└── utils
13 directories, 8 files
2. 进入demo-zhj
项目目录执行gulp
,FEZ会自动打开系统默认浏览器并进入研发环境
➜ demo-zhj git:(master) ✗ gulp
[10:12:46] Requiring external module babel-register
[10:12:52] ---------------------------------------
[10:12:52] * 欢迎使用 FEZ 前端模块化工程开发框架 *
[10:12:52] ---------------------------------------
[10:12:52] Using gulpfile ~/wwwroot/fez/demo-zhj/gulpfile.babel.js
[10:12:52] Starting 'default'...
[10:12:52] Starting 'dev'...
[10:12:52] Starting 'delDev'...
[10:12:52] Finished 'delDev' after 24 ms
[10:12:52] Starting 'copyImg'...
[10:12:52] Starting 'svgSymbol'...
[10:12:52] Starting 'copyFonts'...
[10:12:52] Starting 'copyLib'...
[10:12:52] Starting 'copyCustom'...
[10:12:52] Starting 'compileCss'...
[10:12:52] Starting 'compileAppJs'...
[10:12:52] Finished 'svgSymbol' after 16 ms
[10:12:52] Finished 'copyImg' after 51 ms
[10:12:52] Finished 'copyFonts' after 52 ms
[10:12:52] Finished 'copyLib' after 53 ms
[10:12:52] Finished 'copyCustom' after 54 ms
[10:12:52] Finished 'compileCss' after 230 ms
[10:12:52] 1893 bytes written (0.30 seconds)
[10:12:53] Finished 'compileAppJs' after 378 ms
[10:12:53] Starting 'copyBowerFiles'...
[10:12:53] Starting 'compileHtml'...
[10:12:53] Finished 'copyBowerFiles' after 527 μs
[10:12:53] gulp-inject 2 files into index.html.
[10:12:53] Finished 'compileHtml' after 46 ms
[10:12:53] Starting 'watch'...
[10:12:53] Starting 'qrcodeViewHtml'...
[10:12:53] Starting 'startServer'...
[10:12:53] Finished 'watch' after 5.81 ms
[10:12:53] Finished 'qrcodeViewHtml' after 11 ms
[Browsersync] Access URLs:
----------------------------------------------
Local: http://localhost:8080/zindex.html
External: http://10.0.0.30:8080/zindex.html
----------------------------------------------
UI: http://localhost:5050
UI External: http://10.0.0.30:5050
----------------------------------------------
[Browsersync] Serving files from: ./dev