Maxim Slipenko
798e1dad20
All checks were successful
continuous-integration/drone/push Build is passing
49 lines
1.2 KiB
JavaScript
49 lines
1.2 KiB
JavaScript
const { mkdirSync } = require('fs')
|
|
const cagovBuildSystem = require('@cagov/11ty-build-system')
|
|
const svgContents = require('eleventy-plugin-svg-contents')
|
|
const faviconPlugin = require('eleventy-favicon')
|
|
const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight')
|
|
|
|
module.exports = (eleventyConfig) => {
|
|
eleventyConfig.setUseGitIgnore(false)
|
|
|
|
eleventyConfig.addPlugin(cagovBuildSystem, {
|
|
processors: {
|
|
rollup: {
|
|
file: 'rollup.config.js',
|
|
watch: ['src/js/**/*.js']
|
|
},
|
|
postcss: {
|
|
file: 'postcss.config.js',
|
|
watch: ['src/**/*']
|
|
}
|
|
},
|
|
beforeBuild: () => {
|
|
mkdirSync('dist/css', { recursive: true })
|
|
}
|
|
})
|
|
|
|
eleventyConfig.addPassthroughCopy('./src/fonts/')
|
|
|
|
eleventyConfig.addPlugin(svgContents)
|
|
eleventyConfig.addPlugin(faviconPlugin, {
|
|
destination: './dist'
|
|
})
|
|
|
|
eleventyConfig.addPlugin(syntaxHighlight)
|
|
|
|
eleventyConfig.addCollection('notes', function (collectionApi) {
|
|
return collectionApi.getFilteredByGlob('src/notes/**/*.md')
|
|
})
|
|
|
|
return {
|
|
dir: {
|
|
input: 'src',
|
|
output: 'dist',
|
|
layouts: 'layouts',
|
|
includes: 'includes',
|
|
data: 'data'
|
|
}
|
|
}
|
|
}
|