require-module-main
v0.1.0
Published
## 20180317Sat
Downloads
32
Readme
Status
20180317Sat
Works. But I stopped to investigate whether esm
will solve my problems...
Override Module._findPath
.
We just have to find the case when there is a package.json
. Then defer to original function.
// Need to allow some node_modules to be transpiled by babel-register when using `import-main`.
// Maybe we should make a wrapper called `babel-register-modules` to take care of this...
require('babel-register')({include: ['node_modules/foo']})
require('import-main')({include: ['node_modules/foo']}
Reference
- https://github.com/dherman/defense-of-dot-js/blob/master/proposal.md#detailed-lookup-rules
- http://2ality.com/2017/04/setting-up-multi-platform-packages.html
- http://2ality.com/2017/07/npm-packages-via-babel.html