Package Exports
- ns-require
- ns-require/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ns-require) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ns-require
Require with Namespace.
Basic Usage
import ns from 'ns-require'
const scope = ns({
namespace: 'awesome',
prefix: 'plugin',
})
scope.require('foo') // will resolve to `awesome-plugin-foo`
scope.require('@foo/bar') // will resolve to `@foo/awesome-plugin-bar`With Official Scope
import ns from 'ns-require'
const scope = ns({
namespace: 'awesome',
prefix: 'plugin',
official: 'scope',
})
scope.require('foo') // will resolve to `@scope/plugin-foo`
// and then `awesome-plugin-foo`
scope.require('@foo/bar') // will resolve to `@foo/awesome-plugin-bar`