nw-global-nav-asset-shim
Shims global-nav asset routes.
Last updated 5 years ago by nerdwallet .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install nw-global-nav-asset-shim 
SYNC missed versions from official npm registry.

nw-global-nav-asset-shim

Serve app-site assets from your node app.

This is meant to simplify development of node apps outside of dev-vagrant only. This module should not be used in production.

installation

npm i --save nw-global-nav-asset-shim

usage

var app = require(express)()

if (process.env.NODE_ENV === 'development') {
  var shim = require('nw-global-nav-asset-shim')
  shim({ appsitePath: '/my/dev/app-site' }, app)
}

Shims the following asset routes:

/css
/js
/global-styles

reasoning

When consuming global-nav (via something like nw-nerdlayoutjs) you get a payload used as the layout for your app. Parts of the layout reference global assets that make up things like the global header and footer styles and js. If you want to run your node app outside of dev-vagrant you'll need to serve these assets yourself so something like localhost:3000/css/bundle.min.css resolves correctly. These assets live in your app-site clone, so this shim just serves from your local clone at the expected routes (see above).

Current Tags

  • 1.1.0                                ...           latest (5 years ago)

2 Versions

  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           6 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (1)
Dev Dependencies (1)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |