create manifest file for bundle
npm install basis-company/gulp-manifest.js
var manifest = require('gulp-manifest');
var bundles = [ 'admin', 'user' ];
var rename = true; // rename src files to 'name-hash.ext'
gulp.task('manifest', () =>
gulp.src([
'build/admin.js',
'build/helpers.js',
'build/style.css',
'build/user.js',
'build/version.txt',
])
.pipe(manifest(bundles, rename))
.pipe(gulp.dest('manifest'))
);
{
"starter": "admin.js",
"admin.js": "admin-e7c0073c1167.js",
"helpers.js": "helpers-c9833abeffd8.js",
"style.css": "style-d2024e8e9557.css",
"version": "1.0.0"
}
{
"starter": "user.js",
"user.js": "user-2124834cba23.js",
"helpers.js": "helpers-c9833abeffd8.js",
"style.css": "style-d2024e8e9557.css",
"version": "1.0.0"
}