gulp-bundle-assets-express-middleware
v1.0.2
Published
Express middleware for gulp-bundle-assets
Downloads
3
Maintainers
Readme
gulp-bundle-assets-express-middleware
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')));