Comments (2)
这个是插件给出的提示,并不是报错。
vite 从 v5 版本开始,逐步 废弃 CommonJS
。因此,插件也是跟随 vite 的版本更新变动,逐步废弃 CommonJS
, 只是目前的版本依然保留同时导出 ESM/CJS
,在检测到使用 CJS
导入插件时给出这个提示,但不影响使用。
nodeJS 社区在推动逐步废弃 CommonJS
,以及随着 vite
的版本变动,个人给出一点小小的建议,也许你是时候将你的项目从 cjs
迁移到 esm
了,可以参考 这份 文档 对项目进行改造。不过目前你不做任何改动也依然可以正常使用插件的所有功能,即使 vite到 v6 版本后完全废弃 cjs
,插件还是会在很长一点时间内保留 cjs
的导出以保证对旧版本的兼容。
from vite-plugin-mock-dev-server.
这个是插件给出的提示,并不是报错。
vite 从 v5 版本开始,逐步 废弃
CommonJS
。因此,插件也是跟随 vite 的版本更新变动,逐步废弃CommonJS
, 只是目前的版本依然保留同时导出ESM/CJS
,在检测到使用CJS
导入插件时给出这个提示,但不影响使用。nodeJS 社区在推动逐步废弃
CommonJS
,以及随着vite
的版本变动,个人给出一点小小的建议,也许你是时候将你的项目从cjs
迁移到esm
了,可以参考 这份 文档 对项目进行改造。不过目前你不做任何改动也依然可以正常使用插件的所有功能,即使 vite到 v6 版本后完全废弃cjs
,插件还是会在很长一点时间内保留cjs
的导出以保证对旧版本的兼容。
嗯,我后来也查到了,谢谢
from vite-plugin-mock-dev-server.
Related Issues (20)
- 是否可以支持mock数据低优先级 HOT 10
- mockServer 独立部署安装和启动报错 HOT 3
- mockServer 正常启动,但是接口进 mockServer 服务后报错,和一些实验性建议 HOT 6
- 未配置 vite 的 proxy 参数和插件的 prefix 参数,应输出警告信息。 HOT 3
- websocket不成功 HOT 9
- "[ERROR] Invalid define value (must be an entity name or valid JSON syntax)"... when JSON object is the value HOT 6
- [bug:]Cannot start service: Host version "0.19.8" does not match binary version "0.18.17" HOT 3
- WebSocket mocking issues when ws request contains query params HOT 2
- [ERROR] The entry point "mock/table.ts.timestamp-1710847630001.mjs" cannot be marked as external
- 请求体过大报错 HOT 1
- 请问支持生产环境吗?有没有相关例子 HOT 1
- How to set a global mock config HOT 2
- 无法请求到数据 HOT 6
- 如何支持静态大文件的mock HOT 2
- 多个 vite 配置文件的情况下,server.proxy 配置后不生效 HOT 4
- 建议能够开发出一个支持 `Rspack` 和 `Rsbuild` 的插件 HOT 2
- 建议新增一个辅助开发调试的GUI功能 HOT 1
- 部署mock服务时出现问题
- body内容某些情况下存在JSON解析失败 HOT 1
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 vite-plugin-mock-dev-server.