Skip to content

Wizcorp/link-require

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

link-require

Expose your source folder globally within your project.

This works by essentially creating a symlink of the source directory you wish to expose under node_modules.

Why

Because require('../../../../../../../../../') has to go.

Usage

Installation

npm install --save link-require

Setup

In your package.json:

{
  "scripts": {
    "postinstall": "link-require ./src:app"
   }
}

You can specify multiple mapping as well:

{
  "scripts": {
    "postinstall": "link-require ./src:src ./lib:lib"
   }
}

When requiring

const mySource = require('app/mySource')

About

Symlink source folder(s) of your project to node_modules

Resources

Stars

Watchers

Forks

Packages

No packages published