Disable gzip and source maps for production builds
This disables sourcemap generation for production builds to save on disk space. While useful, source maps are several times larger than our actual used code, so it's best to only keep them around during development. This also turns off gzip, since it is just duplicating files for now; we'll want to reconsider this feature once StackViz is building inside the gate if links start breaking. Change-Id: Ie4c2735c08014f417b8f1f68fc8f6b9e4898dff2
This commit is contained in:
parent
28caae17d6
commit
d2e9ad4fca
14
gulp/tasks/cleanMaps.js
Normal file
14
gulp/tasks/cleanMaps.js
Normal file
@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
var config = require('../config');
|
||||
var gulp = require('gulp');
|
||||
var del = require('del');
|
||||
var path = require('path');
|
||||
|
||||
gulp.task('cleanmaps', function(cb) {
|
||||
|
||||
// It seems to be impossible to disable sourcemaps normally. Instead, delete
|
||||
// them at the end of 'prod'.
|
||||
return del([path.join(config.scripts.dest, 'main.js.map')]);
|
||||
|
||||
});
|
@ -9,6 +9,8 @@ gulp.task('prod', ['clean'], function(cb) {
|
||||
|
||||
global.isProd = true;
|
||||
|
||||
runSequence(['styles', 'fonts', 'views'], 'browserify', 'gzip', cb);
|
||||
runSequence(
|
||||
['styles', 'fonts', 'views'],
|
||||
'browserify', 'cleanmaps', cb);
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user