JSPM

esdoc-alias-plugin

0.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q21412F
  • License MIT

Alias resolver Plugin for ESDoc

Package Exports

  • esdoc-alias-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-alias-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 Alias Plugin

Latest Stable Version License Build Status Documentation

Dependency Status Code Climate Issue Count

This is a plugin to convert import path inside the AST for using ESDoc with alias. Tested only with babel-plugin-module-alias for the moment. Would work with other systems, like webpack resolve.alias.

For example, using babel-plugin-module-alias like that:

{
  "presets": ["es2015", "stage-1"],
  "plugins": [
    ["module-alias", [
      { "src": "./src/app", "expose": "app"  },
      { "src": "./src/core", "expose": "core"  },
      { "src": "./src/locales", "expose": "locales"  },
      { "src": "./src/app/assets", "expose": "assets"  },
    ]]
  ]
}

Can be resolve with esdoc-alias-plugin with this configuration:

{
  "source": "./src",
  "destination": "./doc",
  "plugins": [
    {
      "name": "esdoc-alias-plugin",
      "option": {
        "replaces": [
          {"from": "^app/", "to": "src/app/"},
          {"from": "^core/", "to": "src/core/"},
          {"from": "^locales/", "to": "src/locales/"},
          {"from": "^assets/", "to": "src/app/assets/"}
        ]
      }
    }
  ]
}

Install and Usage

npm install esdoc-alias-plugin

setup plugin property in esdoc.json

{
  "source": "./src",
  "destination": "./doc",
  "plugins": [
    {
      "name": "esdoc-alias-plugin",
      "option": {
        "replaces": [
          {"from": "^core/", "to": "src/core/"}
        ]
      }
    }
  ]
}

execute ESDoc

esdoc -c esdoc.json

LICENSE

MIT

Author

Rit Grégoire@gregwarit