Injects module require statements with the correct relative require path


Install
apm install relative-require@1.6.12

Documentation

Relative Require Build Status Stories in Ready

Injects module require statements with the correct relative require path

Usage

Drag & drop from the tree view

Demo

Right click from the tree view

Demo

Using the hotkey ctrl-alt-r

Demo

Right click in the editor

Demo

Features

  • Import project modules with correct relative path
  • Import from your projects package.json dependencies
  • Import native node modules; fs, path etc.
  • Infers the import statement syntax (require or import) from the active file contents
  • Drag and drop from tree view
  • Right click a file in the tree view to import

Configuration

Option Defaults Description
Omit File Extensions "js", "jsx" Omit the extension from the require path for these file types
Exclude Directories "^\.", "node_modules", "bower_components" Exclude these directories from the module search