Coder Social home page Coder Social logo

Comments (18)

2betop avatar 2betop commented on May 29, 2024

这个等我把这个文档整理下: http://fex-team.github.io/fis3/docs/api/config-glob.html

我先大概说下:

/*.html 命中根目录下面的所有 html 为后缀的文件,但是不命中子目录的。
/**.html 命中根目录下面的所有 html 以及其子目录下面的所有 .html 文件。
xxxx/**/*.html 那么就是 xxxx 目录下面的子目录下面所有.html 文件,不包含xxxx 目录下面的。
xxxx/**.html 那么就是xxxx 目录下面所有 .html 包括子目录

*.html 因为没有限制与哪个目录, fis 里面会自动将他等价于 **/*.html 也就是所有目录下面的 html 文件。

from fis3.

yolio2003 avatar yolio2003 commented on May 29, 2024
fis.set('project.ignore', [
  'publish/**/*',
  //...
])

我的理解,上面这样才是忽略目录下的所有文件吧?为啥默认配置是

fis.set('project.ignore', [
  'publish/**',
  //...
])

这种写法呢

from fis3.

oxUnd avatar oxUnd commented on May 29, 2024

publish/**/*

public/a.js     X
public/a/a.js  √
public/b/b.js  √

** == {*,**/*}

public/a.js     √
public/a/a.js  √
public/b/b.js  √

不过简写的 hack 确实理解起来很费劲,讨论下是否去除。

具体参考文档

http://fex-team.github.io/fis3/docs/api/config-glob.html

from fis3.

2betop avatar 2betop commented on May 29, 2024

public/** 是表示下面所有的文件,而 public/**/* 显然多了一级目录,那么 public/xxxx 文件都不能 match 到,只能 match public 下面的子目录下面文件。

from fis3.

oxUnd avatar oxUnd commented on May 29, 2024

@2betop 整理一下这块的东西,讨论是否去除额外扩展。

from fis3.

yolio2003 avatar yolio2003 commented on May 29, 2024

晕啊,是我自己理解错了。额外扩展开了几遍,最后还是记混了,宁愿多谢字符,支持去除扩展。

from fis3.

2betop avatar 2betop commented on May 29, 2024

那么 我要命中 public 下面所有的 js 后缀应该怎么写?

现在: /public/**.js

glob 原版 /public/{*.js,**/*.js}

from fis3.

2betop avatar 2betop commented on May 29, 2024

我不确认我的理解是否正确,在 glob 里面 ** global star 是搭配目录用的,而不是搭配 文件用的,也就是说 /public/**.js 是没有任何意义,只有 /public/**/*.js 这里面的 ** global star 是有意义,代表 match n 个目录。既然 **.ext 没有意义,为何不扩展它,让它更简单?

from fis3.

oxUnd avatar oxUnd commented on May 29, 2024

@2betop 就如我跟你前面沟通,规范不清晰导致的混用。不理想,这块去除吧。

from fis3.

2betop avatar 2betop commented on May 29, 2024

哪不清晰?

from fis3.

oxUnd avatar oxUnd commented on May 29, 2024

@2betop

glob

* 当前目录文件
** 跨文件夹
**/* 跨文件夹下的文件

扩展

* 当前目录文件
** 跨文件夹
**/* 跨文件夹下的文件
** 当前文件夹文件+跨文件夹下的文件

这不重了吗?

from fis3.

yolio2003 avatar yolio2003 commented on May 29, 2024

对对,@2betop 大神初衷是好的,但是我会凌乱。。。(逃,
或者要不改成 *** 三个!就不乱了 (逃逃逃

from fis3.

2betop avatar 2betop commented on May 29, 2024

@xiangshouding ** 本来就是当前文件夹 + 跨文件夹下的文件, ** 只有在后面接了 '/' 才会变成跨目录了。

不信你用 minimatch 试试 '/**' 本来就是会命中根目录下面所有文件及目录。

我扩展的是 **.ext 这种用法,还是没能明白你们说的冲突是啥。

from fis3.

oxUnd avatar oxUnd commented on May 29, 2024

好,这个事儿我来弄。

在 2015年7月9日,上午10:33,liaoxuezhi [email protected] 写道:

@xiangshouding ** 本来就是当前文件夹 + 跨文件夹下的文件, ** 只有在后面接了 '/' 才会变成跨目录了。

不信你用 minimatch 试试 '/**' 本来就是会命中根目录下面所有文件及目录。

我扩展的是 **.ext 这种用法,还是没能明白你们说的冲突是啥。


Reply to this email directly or view it on GitHub.

from fis3.

2betop avatar 2betop commented on May 29, 2024

去掉吧,后面只会有更多人吐槽 这种用法 /xxx/{*.js,**/*.js}

from fis3.

yolio2003 avatar yolio2003 commented on May 29, 2024

真是个纠结的问题,忽略我吧。。。

from fis3.

oxUnd avatar oxUnd commented on May 29, 2024

@2betop 先等等,让我再考虑考虑。估计 glob 的案例需要整更多。

from fis3.

oxUnd avatar oxUnd commented on May 29, 2024

决定不改了,已经完善文档,相当明确。

from fis3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.