module-path-hook
v1.0.4
Published
Module path hook for Node.js require
Downloads
7,984
Maintainers
Readme
module-path-hook
Module path hook for Node.js require
Installation
npm install module-path-hook
# or use yarn
yarn add module-path-hook
Usage
/**
app/
index.js
foo.js
*/
require('module-path-hook/register')({
// See webpack resolve: https://webpack.docschina.org/configuration/resolve/
alias: {
'@app': '/app/'
}
})
require.resolve('@app') === '/app/index.js'
require.resolve('@app/foo') === '/app/foo.js'
Related
- require-resolve-hook - Module to hook into the Node.js require and require.resolve function
- require-fallback-middle - Module to fallback the Node.js require and require.resolve function
Contributing
- Fork it!
- Create your new branch:
git checkout -b feature-new
orgit checkout -b fix-which-bug
- Start your magic work now
- Make sure npm test passes
- Commit your changes:
git commit -am 'feat: some description (close #123)'
orgit commit -am 'fix: some description (fix #123)'
- Push to the branch:
git push
- Submit a pull request :)
Authors
This library is written and maintained by imcuttle, [email protected].
License
MIT - imcuttle 🐟