Skip to content

Commit

Permalink
added derequire to build
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Nov 9, 2016
1 parent 5a12f56 commit ded796c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var webserver = require('gulp-webserver');
var concat = require('gulp-concat');
var preprocess = require('gulp-preprocess');
var browserify = require('browserify');
var derequire = require('gulp-derequire');
var transform = require('vinyl-transform');
var through2 = require('through2');
var pkg = require('./package.json');
Expand Down Expand Up @@ -42,7 +43,7 @@ gulp.task('release', function(callback) {
message: 'cannot build release as there are uncomitted changes'
});
} else {
sequence('build:dev', 'build:examples', 'test', 'bump', 'reload', 'build:release', 'doc', 'changelog', callback);
sequence('build:examples', 'test', 'bump', 'reload', 'build:release', 'doc', 'changelog', callback);
}
});
});
Expand Down Expand Up @@ -166,7 +167,7 @@ gulp.task('serve:stop', function() {
});

gulp.task('test', function(callback) {
sequence('serve:test', 'lint', 'test:browser', 'test:node', 'serve:stop', callback);
sequence('serve:test', 'lint', 'build:dev', 'test:browser', 'test:node', 'serve:stop', callback);
});

gulp.task('test:browser', function(callback) {
Expand Down Expand Up @@ -236,7 +237,8 @@ var serve = function(isTest) {
};

var build = function(options) {
var filename = buildDirectory + '/matter',
var isDev = options.version.indexOf('-dev'),
filename = buildDirectory + (isDev ? '/matter-dev' : '/matter'),
dest = filename + '.js',
destMin = filename + '.min.js';

Expand All @@ -253,9 +255,10 @@ var build = function(options) {
next(null, file);
});
}))
.pipe(derequire())
.pipe(replace('@@VERSION@@', options.version));

if (options.version.indexOf('-dev') === -1) {
if (isDev === -1) {
compiled.pipe(preprocess({ context: { DEBUG: false } }));
}

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"gulp-clone": "^1.0.0",
"gulp-concat": "^2.6.0",
"gulp-conventional-changelog": "^0.7.0",
"gulp-derequire": "^2.1.0",
"gulp-eslint": "^1.0.0",
"gulp-github-release": "^1.1.0",
"gulp-header": "^1.7.1",
Expand Down

0 comments on commit ded796c

Please sign in to comment.