From 77c3c0b466feef1ef914054dd1cae7458322cc23 Mon Sep 17 00:00:00 2001 From: Sumeet Adur Date: Wed, 23 Dec 2015 10:09:45 +0000 Subject: [PATCH] Create RSS feed in dist --- gulpfile.babel.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 43879cf..2a5a156 100755 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -232,13 +232,15 @@ gulp.task('build', done => { runSequence( // preparatory - ['clean', /* 'scsslint', 'eslint', */ 'download-data', 'create-rss-feed'], + ['clean', /* 'scsslint', 'eslint', */ 'download-data'], // preprocessing (client/templates => .tmp) ['scripts', 'styles', 'templates'], // optimisation (+ copying over misc files) (.tmp/client => dist) ['minify-js', 'minify-css', 'compress-images', 'copy-misc-files'], // finalise the HTML in dist (by inlining small scripts/stylesheets then minifying the HTML) ['finalise-html'], + // create RSS feed in dist + ['create-rss-feed'], done); }); @@ -391,7 +393,7 @@ gulp.task('templates', () => { fs.writeFileSync(`.tmp/thanks.html`, thanksPageHtml); }); -gulp.task('create-rss-feed', ['download-data'], () => { +gulp.task('create-rss-feed', () => { const rssTitle = 'Guffipedia'; const rssLink = 'http://ft.com/guff'; @@ -419,11 +421,11 @@ gulp.task('create-rss-feed', ['download-data'], () => { } rssString += ''; - fs.writeFileSync('rss.xml', rssString); + fs.writeFileSync('dist/rss.xml', rssString); - gulp.src('rss.xml') + gulp.src('dist/rss.xml') .pipe(prettyData({type: 'prettify'})) - .pipe(gulp.dest('.')); + .pipe(gulp.dest('dist')); }); // helpers