Skip to content

Commit

Permalink
add ENV var to skip js rev'ing in dev if you want
Browse files Browse the repository at this point in the history
Change-Id: I7eb1413191d9b0ca0178459b96430c796334d11b
Reviewed-on: https://gerrit.instructure.com/72376
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
  • Loading branch information
evizitei committed Mar 2, 2016
1 parent fe6f31b commit 9be656a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion frontend_build/baseWebpackConfig.js
Expand Up @@ -161,7 +161,11 @@ module.exports = {
new webpack.IgnorePlugin(/(CHANGELOG|LICENSE|README)$/),
new webpack.IgnorePlugin(/package.json/),
new WebpackOnBuildPlugin(function(stats){
child_process.spawn("gulp", ["rev"]);
if(process.env.SKIP_JS_REV){
console.log("skipping rev...");
}else{
child_process.spawn("gulp", ["rev"]);
}
}),
new webpack.PrefetchPlugin("./app/coffeescripts/calendar/ContextSelector.coffee"),
new webpack.PrefetchPlugin("./app/coffeescripts/calendar/TimeBlockRow.coffee"),
Expand Down
8 changes: 7 additions & 1 deletion gulpfile.babel.js
Expand Up @@ -2,6 +2,7 @@ const gulp = require('gulp')
const gulpPlugins = require('gulp-load-plugins')()

const DIST = 'public/dist'

const STUFF_TO_REV = [
'public/fonts/**/*',
'public/images/**/*',
Expand Down Expand Up @@ -38,7 +39,12 @@ const STUFF_TO_REV = [


gulp.task('rev', () => {
gulp.src(STUFF_TO_REV, {
var stuffToRev = STUFF_TO_REV;
if(process.env.SKIP_JS_REV){
// just get fonts and images
stuffToRev = STUFF_TO_REV.slice(0,2)
}
gulp.src(stuffToRev, {
base: 'public', // tell it to use the 'public' folder as the base of all paths
follow: true // follow symlinks, so it picks up on images inside plugins and stuff
})
Expand Down

0 comments on commit 9be656a

Please sign in to comment.