fis icon indicating copy to clipboard operation
fis copied to clipboard

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

Open hefangshi opened this issue 10 years ago • 25 comments

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

$ fis server open

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

$ fis release -d ../dist

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

$ fisp server open

hefangshi avatar Jun 04 '14 14:06 hefangshi

发现一个报错

/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 后就不会触发了。

nwind avatar Jun 09 '14 06:06 nwind

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

oxUnd avatar Jun 09 '14 07:06 oxUnd

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

superddr avatar Aug 14 '14 10:08 superddr

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

hefangshi avatar Aug 14 '14 11:08 hefangshi

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

leesx avatar Nov 25 '14 01:11 leesx

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

leesx avatar Nov 25 '14 01:11 leesx

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

oxUnd avatar Nov 25 '14 01:11 oxUnd

@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 都是可以的。

oxUnd avatar Nov 25 '14 01:11 oxUnd

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

leesx avatar Nov 25 '14 01:11 leesx

fis release -pd ../output

等价于

fis release -p -d ../output

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

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

oxUnd avatar Nov 25 '14 02:11 oxUnd

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

Leega0 avatar Jan 12 '15 09:01 Leega0

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

LzyGod avatar Jan 26 '15 13:01 LzyGod

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

oxUnd avatar Jan 26 '15 22:01 oxUnd

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

oxUnd avatar Jan 26 '15 22:01 oxUnd

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

LzyGod avatar Jan 26 '15 23:01 LzyGod

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

LzyGod avatar Jan 26 '15 23:01 LzyGod

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

在 2015年1月27日,上午7:58,LzyGod [email protected] 写道:

@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 https://github.com/fex-team/fis/issues/70#issuecomment-71564435.

oxUnd avatar Jan 27 '15 00:01 oxUnd

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

LzyGod avatar Jan 27 '15 02:01 LzyGod

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

Leega0 avatar Jan 27 '15 02:01 Leega0

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

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

MichaelGong avatar Jun 17 '15 09:06 MichaelGong

@MichaelGong 看 ISSUE #86

oxUnd avatar Jun 17 '15 09:06 oxUnd

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

lizibaUED avatar Jul 05 '15 14:07 lizibaUED

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

kbqncf avatar Jul 09 '15 07:07 kbqncf

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

Jsamchow avatar Dec 15 '15 07:12 Jsamchow

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

konbeiwu avatar Apr 07 '16 08:04 konbeiwu