Giter Site home page Giter Site logo

Comments (5)

pengzhanbo avatar pengzhanbo commented on July 22, 2024 1

还是要考虑边界情况的,如果 include 配置了 比如 **/*.mock.* 此类通配规则,那么默认的 exclude 有助于帮助内部 fast-glob 避免不必要的匹配导致的额外开销。

当然如果仅 应用默认的 include 规则是我希望的理想使用方式,以及我在 使用文档 给出了一些mock文件管理的建议。那么 exclude 几乎是一个不会产生实际作用的配置。

另外,在开发 vite 插件,和 rollup 插件时,社区有一个 vite 过滤与 include/exclude 模式 @rollup/pluginutils 以规范 文件匹配行为。插件当前的 include/exclude 遵循了这个规范。

from vite-plugin-mock-dev-server.

jiadesen avatar jiadesen commented on July 22, 2024

有个场景是需要在 cypress 目录中独立放置并维护一份专有 mock 文件,仅为自动化测试提供稳定数据,而项目根目录的 mock 数据在团队开发中会经常更改

from vite-plugin-mock-dev-server.

pengzhanbo avatar pengzhanbo commented on July 22, 2024

好问题,我将 cypress 列入到 排除文件中时,没有细想,在排除了 test 目录时很自然的写了 cypress

在做 e2e 测试时,提供稳定的数据支持可以保证 e2e 测试时不会被其他的意外因素干扰。但没有细想到 e2e测试时需要的不是开发时的热数据,而是需要独立于开发时的冷数据,以保证 e2e 测试用例是可用的。

稍后我发布新的版本,删除 cypress 子项。

from vite-plugin-mock-dev-server.

jiadesen avatar jiadesen commented on July 22, 2024

我觉得吧,排除 node_modules 就够了...

from vite-plugin-mock-dev-server.

jiadesen avatar jiadesen commented on July 22, 2024

现在设计的 includeexclude 规则感觉用处不大,几乎所有的项目都只会集中维护一个 mock 文件,exclude 更是几乎用不到

from vite-plugin-mock-dev-server.

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.