Comments (7)
http://fex-team.github.io/fis3/docs/api/config-glob.html
from fis3.
修正回复
deploy 的疑惑
-
你的 public 是第一个 deploy 插件的目标存储地址,而第二个 deploy 是你要把第一个目标地址下产出的文档上传。那么当你没有第一个 deploy 执行产出的时候是无法做到第二个deploy上传成功,因为你第二个 match 是第一个的产出目标地址。
-
当然我们设定的时候并没有设定这样的一个deploy 上传流程,我们的设计是所有的文件都 match 到一个 deploy 属性,而这个属性决定这个文件该到什么地方去。而 match 的对象是源码;如果按照你的这种用法,就相当于 deploy 上挂了俩 task,第一个 task 执行完的结果传给第二个去上传。
-
如果想做到你上面的双 task 的操作,应该是给某一些源码文件设置 deploy 属性,只是这个 deploy 属性上挂两个 task 进行处理。
fis.match('{css/*.css,less/g.less,js/*.js,html/*.html,img/**}', { deploy: [function () { // 这个过程进行挪位置,比如把上面这些资源都挪到 publish 下 }, fis.plugin('http-push', {})] });
-
更好的做法
fis.match('{css/*.css,less/g.less,js/*.js,html/*.html,img/**}', { release: '/publish/$0', url: '$0' }); fis.media('test').match('{css/*.css,less/g.less,js/*.js,html/*.html,img/**}', { deploy: fis.plugin('http-push', { receiver: 'http://my-host/receiver2.php', to: '/data/wapstatic/monkeytao/now' }) });
注意对产出路径的处理
相对路径
请参考插件 fis3-hook-relative
from fis3.
0 麻烦去掉上面 recever2.php
的地址。。。多谢!
1 按照上面的方法 deploy 疑问解除了,但是 url:'$0'
很不解,文档代码都没找到url的逻辑是怎样的。
我使用之后,publish
目录下直接多了一层 $0
现在不用这个 url
一切是正常的。。。
现在的 deploy
fis.match('{css/*.css,less/g.less,js/*.js,html/*.html,img/**,map.json}', {
deploy: fis.plugin('local-deliver', {
to: './publish',
// url: './publish/$0',
})
})
fis.media('test').match('{css/*.css,less/g.less,js/*.js,html/*.html,img/**,map.json}', {
deploy: fis.plugin('http-push', {
receiver: 'xx/receiver2.php',
to: '/data/wapstatic/monkeytao/now'
})
})
2 还是用 domain 的方式解决了相对路径的问题,因为:
fis.hook('relative');
fis.match('*', {
relative: true,
})
[ERROR] Cannot read property 'query' of undefined in [/html/index.html]
3 没有搞清楚为啥我不这样
fis.set('project.ignore', [
'save/{*,**/*}',
//...
])
publish
下面就会有 save
文件夹
值得注意的是上面我的 publish.match
以及任何地方[默认文档中的默认参数]都没有 save
的呀
4 这个 deploy 和 release 的接口名字,很让人纠结,我的理解因为其实是 deploy要用到 release 的,
a:
release
改为deploypath
命令release
为deploy
b:release
保留deploy
改为releaseaction
。。。
5 查了很多文档,发现 gulp grunt 都是考虑不支持把依赖装在全局的,理由是本地按需要维护,全局互相容易冲突。
fis 是全局的。
尝试了使用 NODE_PATH 添加 fis3 专用 node_modules ,但是报错找不到插件等。
是否考虑支持我这样用 NODE_PATH 共享依赖,不污染到全局,毕竟 fis 很多依赖和插件等都不是常用的 node 模块
from fis3.
先说 $0
是 match 的属性不是 deploy 的属性,你这块看差了。
关于 NODE_PATH 设置 FIS3 也是严格按照 NODE 的查找规则,这个你再看看。
之所以全局扫文件是因为 FIS3 是按照项目来处理的,而对扫描到的文件进行文件属性分配,这些属性决定了如何构建这个文件。详细请参考文档;
from fis3.
想要在 local-deliver 之前,清空 publish 目录,现在这样写了
// fis.match('*', {
fis.match('{less/**,html/**,img/**,js/**,map.json}', {
deploy: [
function(options, modified, total, next) {
require('del')(['./publish/**'], function() {
next()
})
},
fis.plugin('local-deliver', {
to: './publish',
}),
]
})
from fis3.
赞!
from fis3.
赞 fis3, 虽然还有不少的意外,但是我们项目最基本的功能已经能用了,而且最终配置非常简洁
from fis3.
Related Issues (20)
- 就告诉我作者是不是跑路了? HOT 2
- fis.match不能调用parser自定义方法
- _handle.Pngquant is not a constructor HOT 3
- fis3中cache.jsbug HOT 2
- 麻烦给个支持node版本说明 HOT 6
- optimizer.png-compressor: _handle.Pngcrush is not a constructor是什么意思 HOT 2
- fis3能不能集成rollup HOT 1
- fs3 [ v3.4.45 ] node [ v14.16.0 ] 执行 fis3 release -d ../dist 抛出异常 The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined HOT 2
- 启用了loader插件报message.content.replace is not a function
- fis3-deploy-http-push 的问题 HOT 1
- fis3依赖fis3-deploy-http-push2.0.6,fis3-deploy-http-push2.0.6依赖winston2.1.1,当我升级node版本到14,vue项目编译时报错(node:31521) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency HOT 3
- Update packages to avoid introducing vulnerablities HOT 2
- Trying to get in touch regarding a security issue
- 似乎在mac12.1系统版本里面热更新不生效了 HOT 3
- 在mock/server.conf下配置proxy时,如何替换/删除uri的前缀?
- 增加nodejs 14+支持 HOT 4
- react-router-dom的BrowserRouter,fis-conf该怎么配置才能解决再次刷新页面会显示404这个问题 HOT 1
- 不兼容高版本 node HOT 4
- fis3支持node版本问题 HOT 1
- 在deploy中插件中改变modified中文件内容,total中的文件内容不改变,fis3-deploy-replace改变内容后 fis3-deploy-zip打包出去的内容未改变
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fis3.