1.0.0 • Published 7 years ago

esdoc-inject-assets-plugin v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

esdoc-inject-assets-plugin

ESDoc plugin for adding custom stylesheets and scripts to the template.

Installation

npm install esdoc-inject-assets-plugin

Config

{
  "plugins": [
    {
      "name": "esdoc-inject-assets-plugin",
      "option": {
        "enable": true,
        "assets": [
          "files/foo.js",
          "files/bar.css",
          "https://unpkg.com/jquery@3.2.1/dist/jquery.js",
          {
            "path": "https://fonts.googleapis.com/css?family=Roboto",
            "type": "link"
          },
          {
            "path": "node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.eot",
            "inject": false
          }
        ]
      }
    }
  ]
}

Options

PropertyTypeDescriptionDefault
enablebooleanSet to false to disable the plugin.true
assetsArray.<string|object>An array of CSS and JS files to inject. If a string is provided, it is assumed to be the asset path.[]
assets[].pathstringThe relative path (or absolute URL) to the CSS or JS file to inject.Required
assets[].typestringOne of 'link' or 'script'.Inferred from the file extension of path
assets[].absolutebooleanIf true, will not prepend a local path.Inferred if path looks like a URL
assets[].copybooleanIf true, will copy the asset into the destination directory in assets/.true, unless absolute
assets[].injectbooleanIf false, will copy the file but not inject a tag.true
assets[].attrsObject.<string,string>Attributes to add to the link or script element.{}