Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Custom RequireNew to Visual Studio Code? Get it now.
Custom Require

Custom Require

Nacho Decima

|
4 installs
| (0) | Free
Go to Definition support for custom require-like functions (myRequire, etc.)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Custom Require

Go to Definition support for custom require-like functions (e.g., myRequire).

VS Code's built-in "Go to Definition" (Ctrl+Click / Cmd+Click) doesn't work with custom wrapper functions that internally use require. This extension fills that gap.

Features

1. Navigate to file from string path

const Home = myRequire('./home.js');
// Ctrl+Click on './home.js' → opens home.js

2. Navigate to method/property definition

const Home = myRequire('./home.js');
Home.getValue();
// Ctrl+Click on getValue → goes to getValue definition in home.js

3. Navigate to destructured export

const { constante1, constante2 } = myRequire('./constantes.js');
// Ctrl+Click on constante1 → goes to where it's defined in constantes.js

console.log(constante1);
// Ctrl+Click also works on standalone references

Supported export patterns in target files

  • module.exports = { key: value }
  • module.exports = variable (follows variable to its object literal declaration)
  • module.exports = class { method() {} }
  • anyName.exports = value
  • module.exports.key = value
  • exports.key = value
  • export function name() / export const name / export { name }

Configuration

In your VS Code settings.json:

{
  "customRequire.functionNames": ["myRequire"]
}

Add multiple function names if needed:

{
  "customRequire.functionNames": ["myRequire", "customLoad", "lazyRequire"]
}

Installation

  1. Install from the VS Code Marketplace
  2. Or download the .vsix from the releases page

Development

git clone https://github.com/NachoDecima/custom-require
cd custom-require
npm install
npm run compile

Press F5 in VS Code to launch an Extension Development Host window.

Requirements

  • VS Code ^1.96.0
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft