Skip to content

Commit afc9531

Browse files
committed
fix: remove deprecated api.
1 parent a9b0511 commit afc9531

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

example/webpack/src/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,12 @@ fetch('/repos/jaywcjlove/webpack-api-mocker')
2020
.then(response => response.json())
2121
.then(data => {
2222
document.getElementById('github').innerText = `from github api: webpack-api-mocker star count: ${data.stargazers_count}`
23-
});
23+
});
24+
25+
fetch('/api/login/account', {
26+
method: 'POST',
27+
headers: {
28+
'Content-Type': 'application/json'
29+
},
30+
body: JSON.stringify({ password: '888888', username: 'admin' })
31+
})

packages/core/src/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,6 @@ export default function mockerApi(app: Application, watchFile: string | string[]
340340
} catch (e) {}
341341
var module = require.cache[modulePath];
342342
if (!module) return;
343-
// remove reference in module.parent
344-
if (module.parent) {
345-
module.parent.children.splice(module.parent.children.indexOf(module), 1);
346-
}
347343
// https://github.com/jaywcjlove/mocker-api/issues/42
348344
clearModule(modulePath);
349345
}

0 commit comments

Comments
 (0)