MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / createRequire

Function createRequire

packages/vite/shims/node-module.ts:3–11  ·  view source on GitHub ↗
(_url: string)

Source from the content-addressed store, hash-verified

1// Minimal shim for `node:module` to satisfy imports from vite/module-runner.
2// We only provide createRequire to avoid hard crashes; it is a noop in NS.
3export function createRequire(_url: string) {
4 const req: any = function () {
5 throw new Error('createRequire is not supported in NativeScript runtime');
6 };
7 req.resolve = function () {
8 throw new Error('require.resolve is not supported in NativeScript runtime');
9 };
10 return req;
11}
12
13export default { createRequire };

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected