From: Geoff Kimball Date: Thu, 17 Mar 2016 16:27:22 +0000 (-0700) Subject: Create individual JS files for each plugin, and add them to the dist folder. Allows... X-Git-Tag: v6.2.1~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0eda0a24fc9111fcdbce7569345315e4b66330d3;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Create individual JS files for each plugin, and add them to the dist folder. Allows users without Babel to use individual JS plugins. Closes #8406 --- diff --git a/gulp/deploy.js b/gulp/deploy.js index d491d174e..1f399d434 100644 --- a/gulp/deploy.js +++ b/gulp/deploy.js @@ -35,7 +35,7 @@ var CURRENT_VERSION = require('../package.json').version; var NEXT_VERSION; gulp.task('deploy', function(cb) { - sequence('deploy:prompt', 'deploy:version', 'deploy:dist', 'deploy:settings', 'deploy:commit', 'deploy:templates', cb); + sequence('deploy:prompt', 'deploy:version', 'deploy:dist', 'deploy:plugins', 'deploy:settings', 'deploy:commit', 'deploy:templates', cb); }); gulp.task('deploy:prompt', function(cb) { @@ -76,6 +76,12 @@ gulp.task('deploy:dist', ['sass:foundation', 'javascript:foundation'], function( .pipe(gulp.dest('./dist')); }); +// Copies standalone JavaScript plugins to dist/ folder +gulp.task('deploy:plugins', function() { + gulp.src('_build/assets/js/plugins/*.js') + .pipe(gulp.dest('dist/plugins')); +}); + // Generates a settings file gulp.task('deploy:settings', function(cb) { var options = { diff --git a/gulp/javascript.js b/gulp/javascript.js index 4ddcad69c..f350f0a2f 100644 --- a/gulp/javascript.js +++ b/gulp/javascript.js @@ -30,6 +30,7 @@ gulp.task('javascript:foundation', function() { return gulp.src(FOUNDATION) .pipe(babel() .on('error', onBabelError)) + .pipe(gulp.dest('_build/assets/js/plugins')) .pipe(concat('foundation.js')) .pipe(gulp.dest('_build/assets/js')); });