hapikachu

Asset management for Hapi

hapikachu

Asset management for Hapi

Install hapikachu by either running npm install hapikachu in your sites working directory or add 'hapikachu' to the dependencies section of the 'package.json' file and run npm install. Hapikachu is under development and is not yet ready for production.

hapikachu require route permissions to be granted on the server.

In your route handlers :

handlerfunction () {
  this.assets.addJavascript(
    "alert('Hello world!');", 'inline'
  );
}

In your templates :

  <%- assets.css %>
  <%- assets.js %>
hapikachu: {
  basePath: '/path/to/my/js/and/css/files',
  assets: {
    js: [
      '//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.2/jquery.min.js',
      '/public/js/vendor/jquery-ui-1.10.3.custom.min.js',
      '/public/js/vendor/bootstrap.min.js',
      '/public/js/custom/main.js'
    ],
    css: [
      {
        type: 'less',
        path:  '/less/',
        file: 'main.less'
      }
    ]
  }
}