From 9ed3416fe6a8aa6e8d2c259e11e80700a62ca89a Mon Sep 17 00:00:00 2001 From: Westly Wright Date: Wed, 25 Apr 2018 10:35:05 -0700 Subject: [PATCH] updates dockerfile to rebuild when js/css change --- Dockerfile.dev | 1 + gulpfile.babel.js | 16 ++-------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/Dockerfile.dev b/Dockerfile.dev index 3069dfa4a3a..85930bb6660 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -12,6 +12,7 @@ RUN ln -s /site/config.toml /run \ && ln -s /site/data /run \ && ln -s /site/layouts /run \ && ln -s /site/src /run \ + && ln -s /site/static /run \ && ln -s /site/themes /run \ && ln -s /site/scripts /run diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 08f66e8dd36..2bd0584628b 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -75,9 +75,9 @@ gulp.task('init-watch', () => { }); $.watch('src/sass/**/*.scss', () => gulp.start('sass')); $.watch('node_modules/rancher-website-theme/**/*.scss', () => gulp.start('sass')); - $.watch('src/js/**/*.js', () => gulp.start('js')); + $.watch('src/js/**/*.js', () => gulp.start('build:app')); $.watch('src/img/**/*', () => gulp.start('img')); - $.watch(['archetypes/**/*', 'data/**/*', 'content/**/*', 'layouts/**/*', 'static/**/*', 'themes/**/*', 'node_modules/rancher-website-theme/**/*', 'config.toml'], () => gulp.start('hugo-dev')); + $.watch(['archetypes/**/*', 'data/**/*', 'content/**/*', 'layouts/**/*', 'static/**/*.{js,css}', 'themes/**/*', 'node_modules/rancher-website-theme/**/*', 'config.toml'], () => gulp.start('hugo-dev')); }); @@ -129,18 +129,6 @@ gulp.task('build:app', () => { .pipe(gulp.dest('static/js')); }); -gulp.task('js', () => { - return gulp.src([ - 'src/js/**/*.js' - ]) - .pipe($.plumber({ errorHandler: onError })) - .pipe($.babel()) - .pipe($.concat('app.js')) - .pipe($.if(isProduction, $.uglify())) - .pipe($.size({ gzip: true, showFiles: true })) - .pipe(gulp.dest('static/js')); -}); - gulp.task('fonts', () => { return gulp.src('src/fonts/**/*.{woff,woff2}') .pipe(gulp.dest('static/fonts'));