Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import autoprefixer from 'autoprefixer-core';
import browserSync from 'browser-sync';
import del from 'del';
import nunjucks from 'nunjucks';
import map from 'vinyl-map';
import quaff from 'quaff';
import runSequence from 'run-sequence';
import yargs from 'yargs';
const $ = gulpLoadPlugins();
const args = yargs.argv;
const bs = browserSync.create();
const config = require('./config');
let data = quaff(config.dataFolder);
let basePath = args.production ? url.resolve('/', config.deploy.key) + '/' : '/';
data.PATH_PREFIX = basePath;
let fullPath = url.format({
protocol: 'http',
host: config.deploy.bucket,
pathname: config.deploy.key
}) + '/';
data.PATH_FULL = fullPath;
let published_stories = data.metadata.storylist.filter((d) => d.published);
data.LATEST_STORY = published_stories[published_stories.length - 1];
let env = nunjucks.configure(config.templateFolder, {autoescape: false});