Skip to content

Commit 0e4a4aa

Browse files
committed
allow to define full context that will be injected in index.html
1 parent 55dcf76 commit 0e4a4aa

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = function(gulp, tasks, config) {
3434
}
3535

3636
if (tasks.indexOf('index') !== -1) {
37-
require('./tasks/index')(gulp, tasks, config.bases.dist, config.app.index, config.appName);
37+
require('./tasks/index')(gulp, tasks, config.bases.dist, config.app.index, config.env.context);
3838
}
3939

4040
if (tasks.indexOf('jshint') !== -1) {

tasks/index.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var extend = require('extend'),
77
preprocess = require('gulp-preprocess'),
88
_ = require('underscore');
99

10-
module.exports = function(gulp, tasks, dest, index, appName) {
10+
module.exports = function(gulp, tasks, dest, index, context) {
1111
function injectIndex() {
1212
// don't read, just insert paths
1313
var srcOptions = {
@@ -28,9 +28,7 @@ module.exports = function(gulp, tasks, dest, index, appName) {
2828
.pipe(gulpInject(gulp.src(cssFiles, srcOptions), injectOptions))
2929
.pipe(gulpInject(gulp.src(jsFiles, srcOptions), extend({}, injectOptions)))
3030
.pipe(preprocess({
31-
context: {
32-
APP: appName
33-
}
31+
context: context
3432
}))
3533
.pipe(minifyInline())
3634
.pipe(minifyHtml({

0 commit comments

Comments
 (0)