gulp-bundle-assets-express-middleware

1.0.2 • Public • Published

gulp-bundle-assets-express-middleware NPM version

Express middleware for gulp-bundle-assets

Install

npm install --save gulp-bundle-assets-express-middleware

Usage

var gulpBundleAssets = require('gulp-bundle-assets-express-middleware');
var express = require('express');
var app = express();
// ... configure view engine
 
// configure "bundle" view property on every response
// to contain the contents of "bundle.result.json"
app.use(gulpBundleAssets());
 
app.get('/', function(req, res) {
  res.render('index', { title: 'My App' });
});
 
app.listen(3000);

See here for a detailed explanation

API

resultPath

Type: string

Default: <fully qualified path of file where call was made from>/bundle.result.json

If your app is not in the same directory as your bundle.result.json, simply provide the fully qualified path to its location, e.g.:

app.use(gulpBundleAssets(path.join(__dirname, '../bundle.result.json')));

License

MIT

Package Sidebar

Install

npm i gulp-bundle-assets-express-middleware

Weekly Downloads

0

Version

1.0.2

License

MIT

Last publish

Collaborators

  • chmontgomery