UNPKG

@markusantonwolf/ta-foodtrucks

Version:

TA-Foodtrucks plugin shows the next food truck and street food dates in your area based on Craftplaces API. You can customize the endpoints to get all dates for a specific vendor, for a specific city or just for a location you are interested in. The light

51 lines (46 loc) 1.8 kB
const config = require('config') const { src, dest, parallel } = require('gulp') const postcss = require('gulp-postcss') const purgecss = require('@fullhuman/postcss-purgecss') const SOURCE_STYLES = config.get('source.styles') const DESTINATION_STYLES = config.get('destination.styles') const SOURCE_PLUGIN_CSS = config.get('source.plugin_css') const DESTINATION_STYLES_CSS = config.get('destination.plugin_css') const PURGE_STYLES = config.get('purge.styles') const PURGE_PLUGIN = config.get('purge.plugin') const STYLES_DESTINATION = './dist/styles' const styles_styles = () => { const postcssOptions = [require('tailwindcss'), require('autoprefixer')] if (process.env.NODE_ENV === 'production') { postcssOptions.push( purgecss({ content: PURGE_STYLES, defaultExtractor: (content) => content.match(/[\w-/.:]+(?<!:)/g) || [], }) ) postcssOptions.push( require('cssnano')({ preset: 'default', }) ) } return src(SOURCE_STYLES).pipe(postcss(postcssOptions)).pipe(dest(DESTINATION_STYLES)) } const styles_taAnalytics = () => { const postcssOptions = [require('tailwindcss'), require('autoprefixer')] if (process.env.NODE_ENV === 'production') { postcssOptions.push( purgecss({ content: PURGE_PLUGIN, defaultExtractor: (content) => content.match(/[\w-/.:]+(?<!:)/g) || [], }) ) postcssOptions.push( require('cssnano')({ preset: 'default', }) ) } return src(SOURCE_PLUGIN_CSS).pipe(postcss(postcssOptions)).pipe(dest(DESTINATION_STYLES_CSS)) } module.exports.styles = parallel(styles_styles, styles_taAnalytics)