Package Exports
- esdoc-importpath-plugin
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 (esdoc-importpath-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ESDoc Import Path Plugin
This is a plugin that converts the import path in documentation. ESDoc displays the import path of class/function into the document. However, the import path may be different from real import path because usually ES2015 is transpiled to use it.
For example, src/MyClass.js
will be referred to as import MyClass from 'my-module/src/MyClass.js'
in the documentation.
However, in practice it is different from the real import path when you use because it is transpiled
(for example, import MyClass from 'my-module/lib/MyClass.js'
).
Therefore, convert the import path by using following setting.
{
"source": "./src",
"destination": "./doc",
"plugins": [
{
"name": "esdoc-importpath-plugin",
"option": {
"replaces": [
{"from": "^src/", "to": "lib/"}
]
}
}
]
}
from
is regular expression and to
is letter. In the internal from
and to
are used with String#replace(new RegExp (from), to)
.
When writing multi rules, it will also be carried out transformation many times.
For example, [{from: "^src/", to: "lib/"}, {from: "MyFooClass", to: "my-foo"}]
converted as follows:
my-module/src/MyFooClass.js
=>my-module/lib/MyFooClass.js
=>my-module/lib/my-foo
Install
npm install esdoc-importpath-plugin
Config
{
"source": "./src",
"destination": "./doc",
"plugins": [
{
"name": "esdoc-importpath-plugin",
"option": {
"replaces": [
{"from": "^src/", "to": "lib"}
]
}
}
]
}
LICENSE
MIT