diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f6c61b..a21c9e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +# [2.9.0](https://github.com/anncwb/vite-plugin-mock/compare/v2.5.0...v2.9.0) (2021-07-05) + +### Bug Fixes + +- ensure that the post with parameters are matched,fix [#29](https://github.com/anncwb/vite-plugin-mock/issues/29) ([4cb55f8](https://github.com/anncwb/vite-plugin-mock/commit/4cb55f87def1e3edf07937ce48b0cfc594f2b88d)) +- improve path matching logic, fix [#25](https://github.com/anncwb/vite-plugin-mock/issues/25) ([5079e4b](https://github.com/anncwb/vite-plugin-mock/commit/5079e4ba1c713aaba2facc87dfb289ea0916c231)) +- loss request headers in PROD mode ([#23](https://github.com/anncwb/vite-plugin-mock/issues/23)) ([76302df](https://github.com/anncwb/vite-plugin-mock/commit/76302df9cc5a23fe0ccd001787bffbb4c012cc83)), closes [#15](https://github.com/anncwb/vite-plugin-mock/issues/15) +- make sure ignore matches the file correctly ([b612a09](https://github.com/anncwb/vite-plugin-mock/commit/b612a0934b7dcaae423450a56139cc9b9749c43e)) +- support node12 ([fdfed60](https://github.com/anncwb/vite-plugin-mock/commit/fdfed60b6d8859bdcf8292c30859101f47d758b5)) + +### Features + +- remove supportTs, change to automatic judgment ([4625e59](https://github.com/anncwb/vite-plugin-mock/commit/4625e59429b4fc06ff4f911d681ee4999661c3ec)) +- response return url ([#27](https://github.com/anncwb/vite-plugin-mock/issues/27)) ([de9ed27](https://github.com/anncwb/vite-plugin-mock/commit/de9ed276b61c18cdfe0509df21921bc3ddf9d767)) + +### Reverts + +- revert 2.5.0, fix [#22](https://github.com/anncwb/vite-plugin-mock/issues/22) ([d5ac0d6](https://github.com/anncwb/vite-plugin-mock/commit/d5ac0d68a67f4e4cc568ef1eff12f2ba425553e8)) + # [2.8.0](https://github.com/anncwb/vite-plugin-mock/compare/v2.5.0...v2.8.0) (2021-06-16) ### Bug Fixes diff --git a/package.json b/package.json index 4e448a0..0da022f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vite-plugin-mock", - "version": "2.8.1-beta.5", + "version": "2.9.0", "description": "A mock plugin for vite", "main": "dist/index.js", "files": [ diff --git a/src/index.ts b/src/index.ts index 1cff4d2..c4d6b56 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,7 +22,7 @@ export function viteMockServe(opt: ViteMockOptions): Plugin { if (!fileExists(defaultPath)) { defaultPath = getDefaultPath(false); if (!fileExists(defaultPath)) { - throw new Error('vite-plugin-vue-mock need to set the entry file.'); + defaultPath = ''; } } @@ -53,7 +53,7 @@ export function viteMockServe(opt: ViteMockOptions): Plugin { }, async transform(code: string, id: string) { - if (isDev || !id.endsWith(injectFile)) { + if (isDev || !injectFile || !id.endsWith(injectFile)) { return null; }