Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FAQ] fis release 之后在哪查看构建产出 #70

Open
hefangshi opened this issue Jun 4, 2014 · 25 comments
Open

[FAQ] fis release 之后在哪查看构建产出 #70

hefangshi opened this issue Jun 4, 2014 · 25 comments
Labels

Comments

@hefangshi
Copy link
Member

如果没有指定或者设置常量,则会存放到用戶根目录下。可以使用以下命令打开。

$ fis server open

如果希望指定产出目录,可以使用

$ fis release -d ../dist

如果使用的是二次封装后的FIS解决方案,将fis替换成解决方案的命令即可,如

$ fisp server open
@hefangshi hefangshi added the faq label Jun 4, 2014
@nwind
Copy link
Member

nwind commented Jun 9, 2014

发现一个报错

/usr/local/lib/node_modules/fis/node_modules/fis-command-server/lib/util.js:6
    fis.log.notice('browse ' + path.yellow.bold + '\n');
                                          ^
TypeError: Cannot read property 'bold' of undefined
    at Object._.open (/usr/local/lib/node_modules/fis/node_modules/fis-command-server/lib/util.js:6:43)
    at Object.exports.open (/usr/local/lib/node_modules/fis/node_modules/fis-command-server/lib/server.js:97:11)
    at Command.<anonymous> (/usr/local/lib/node_modules/fis/node_modules/fis-command-server/server.js:143:28)
    at Command.<anonymous> (/usr/local/lib/node_modules/fis/node_modules/commander/index.js:256:8)
    at Command.EventEmitter.emit (events.js:98:17)
    at Command.parseArgs (/usr/local/lib/node_modules/fis/node_modules/commander/index.js:479:12)
    at Command.parse (/usr/local/lib/node_modules/fis/node_modules/commander/index.js:377:21)
    at Object.fis.cli.run (/usr/local/lib/node_modules/fis/fis.js:127:19)
    at Object.<anonymous> (/usr/local/lib/

是 else 分支的问题,启动 server 后就不会触发了。

@oxUnd
Copy link
Contributor

oxUnd commented Jun 9, 2014

@nwind 这个问题已在上周修复

@superddr
Copy link

怎么才能在config里面配置发布路径,这样以后打fis release就不用-d了?

@hefangshi
Copy link
Member Author

@superddr 有一个deploy设置,可以参考一下 http://fis.baidu.com/docs/api/fis-conf.html#deploy

@leesx
Copy link

leesx commented Nov 25, 2014

$ fis release -pd ./output 视频中怎么是这句话

@leesx
Copy link

leesx commented Nov 25, 2014

视频那个美女讲的 怎么和文档不对应。晕啊,搞一个版本啊

@oxUnd
Copy link
Contributor

oxUnd commented Nov 25, 2014

@leesx -d 后面可以跟任意的一个目录

@oxUnd
Copy link
Contributor

oxUnd commented Nov 25, 2014

@leesx 可以看帮助信息

➜   fis release -h

  Usage: release [options]

  Options:

    -h, --help             output usage information
    -d, --dest <names>     release output destination
    -m, --md5 [level]      md5 release option
    -D, --domains          add domain name
    -l, --lint             with lint
    -t, --test             with unit testing
    -o, --optimize         with optimizing
    -p, --pack             with package
    -w, --watch            monitor the changes of project
    -L, --live             automatically reload your browser
    -c, --clean            clean compile cache
    -r, --root <path>      set project root
    -f, --file <filename>  set fis-conf file
    -u, --unique           use unique compile caching
    --verbose              enable verbose output
 -d, --dest <names>     release output destination

-d 需要一个目录参数,-d ../dist or -d ../../../xxxxx 都是可以的。

@leesx
Copy link

leesx commented Nov 25, 2014

谢谢,这么高效的回复。视频中 -pd是什么意思 。还有$ npm install -g fis-postpackager-simple 我安装上了 但是执行fis release -opm 会出现这个 [ERROR] unable to load plugin [fis-postpackager-simple]

@oxUnd
Copy link
Contributor

oxUnd commented Nov 25, 2014

fis release -pd ../output

等价于

fis release -p -d ../output

然后再对照help就知道,这条命令的意思是打包并产出到output目录

这种组合方式是_L/Uinx_标准用法。

@Leega0
Copy link

Leega0 commented Jan 12, 2015

为什么我的输出目录文件和原始文件一样了,好像只执行了个copy命令,并不是发布后的样子

@LzyGod
Copy link

LzyGod commented Jan 26, 2015

执行 fis release
报错 missing config file [fis-conf.js]怎么办

@oxUnd
Copy link
Contributor

oxUnd commented Jan 26, 2015

@LzyGod FIS是可以没有配置文件的,就做一些简单的路径(URL)替换、资源压缩等,但是一般对于工程是需要特殊的插件、打包等的配置的,所以需要一个配置文件。按照提示,这个配置文件的名字就叫fis-conf.js,所以你只需要在你的项目目录底下建一个fis-conf.js即可。具体配置哪些东西,可以参考WIKI https://github.com/fex-team/fis/wiki/配置API

@oxUnd
Copy link
Contributor

oxUnd commented Jan 26, 2015

@Leega0 FIS默认是不会更改你的目录结构的,需要你自己去制定自己的目录规范以及发布规范,参见 https://github.com/fex-team/fis/wiki/%E9%85%8D%E7%BD%AEAPI#roadmappath

@LzyGod
Copy link

LzyGod commented Jan 26, 2015

@xiangshouding fis-cnf.js是配置一些规则,但是我没有写的时候,默认也不应该报警告,我刚刚安装时可以执行成功,过了几个小时候就不行了,我都重装nodejs,fis好几次了

@LzyGod
Copy link

LzyGod commented Jan 26, 2015

@xiangshouding 对了,输入fis release之后 output [WARNI] missing config file [fis-conf.js]
过一段时间后再output [ERROR] Maximum call stack size exceeded

@oxUnd
Copy link
Contributor

oxUnd commented Jan 27, 2015

你可以通过 fis release --verbose 看一下具体报错的位置,贴一下,可能文件太多或者其他原因导致。

在 2015年1月27日,上午7:58,LzyGod notifications@github.com 写道:

@xiangshouding https://github.com/xiangshouding 对了,输入fis release之后 output [WARNI] missing config file [fis-conf.js]
过一段时间后再output [ERROR] Maximum call stack size exceeded


Reply to this email directly or view it on GitHub #70 (comment).

@LzyGod
Copy link

LzyGod commented Jan 27, 2015

@xiangshouding 谢谢你提供的帮助,目前问题解决了,是我进盘符时操作错误,没有进入到指定盘符

@Leega0
Copy link

Leega0 commented Jan 27, 2015

@xiangshouding 问题解决了,还是给后面的小白参考下,-d只会执行输出操作,想要输出压缩或者md5的也必须带上-o --md5才行

@MichaelGong
Copy link

请问:我使用的 fis release -o --md5 -d ./build 生成的文件 ,为什么所有的href或者src的内容都是以“/”开头的(如下),能不能设置以“./”开头? 小白,求解答!

<link rel="stylesheet" type="text/css" href="/css/normalize_5f79cb1.css">

@oxUnd
Copy link
Contributor

oxUnd commented Jun 17, 2015

@MichaelGong 看 ISSUE #86

@lizibaUED
Copy link

fis release -d ./test之后,在test中打开静态html发现css等路径都是相对根目录的,如/css/index.css,我想修改成相对的,如css/index.css,该怎么配置呢

@kbqncf
Copy link

kbqncf commented Jul 9, 2015

@lizibaUED 似乎没有办法进行这样的配置。既然静态资源的路径都是相对于根目录,那么你可以在根目录下使用 fis server start 命令来启动本地的调试服务器,这样你就可以访问到这样静态资源了。具体的配置可以参考 http://fis.baidu.com/docs/api/fis-conf.html#roadmapdomainhttp://fis.baidu.com/docs/api/fis-conf.html#部署配置

@shaoless
Copy link

请问fis 设置自定义目录后,可以恢复到默认的目录格式吗?

@konbeiwu
Copy link

konbeiwu commented Apr 7, 2016

[WARNI] missing config file [fis-conf.js]
[ERROR] Maximum call stack size exceeded
可以告诉该这么处理么

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests