JSPM

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

DocPad plugin that mounts bower components in web server middleware

Package Exports

  • docpad-plugin-bowermount

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 (docpad-plugin-bowermount) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

bower-mount Plugin for DocPad

DocPad plugin that auto-mounts bower components in web server middleware (currently only JS components). Best fits for development environment. Assumes that in production environment JS files are bundled in static files.

It's enabled only in development environment by default

Install

Install it from you Docpad project:

npm install docpad-plugin-bowermount --save-dev

Next time you run docpad run your bower components will be available via web.

For example, if you installed jquery via bower install jquery and docpad run creates server accessible via http://localhost:9778 you can access jquery lib via http://localhost:9778:/scripts/jquery.js

You'd probably want to bundle your components into static files on build step and use this plugin to cleap your project directory clean

RequireJS: if you're using RequireJS you can set relative path to your configuration file in rjsConfig (default value is scripts/main.js) and if it exists, paths from there will be used to determine components path. Here is an example of your docpad.coffee with this configuration:

# ==================
# Environment
environments:
  development:
    plugins:
      bowermount:
        rjsConfig: 'path/to/my/requirejs/config'

History

You can discover the history inside the History.md file

License

Licensed under the incredibly permissive MIT License
Copyright © 2013+ Sergey Lukin