organization: adapt new buildAllCss and buildAllJs to the existing system
This commit is contained in:
parent
e08549e9d6
commit
7768ebe31a
4 changed files with 10 additions and 10 deletions
|
|
@ -20,19 +20,15 @@ import events from './src/_config/events.js';
|
||||||
import filters from './src/_config/filters.js';
|
import filters from './src/_config/filters.js';
|
||||||
import plugins from './src/_config/plugins.js';
|
import plugins from './src/_config/plugins.js';
|
||||||
import shortcodes from './src/_config/shortcodes.js';
|
import shortcodes from './src/_config/shortcodes.js';
|
||||||
import {buildAllCss} from './src/_config/plugins/css-config.js';
|
|
||||||
import {buildAllJs} from './src/_config/plugins/js-config.js';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default async function (eleventyConfig) {
|
export default async function (eleventyConfig) {
|
||||||
|
// --------------------- Events: before build
|
||||||
eleventyConfig.on('eleventy.before', async () => {
|
eleventyConfig.on('eleventy.before', async () => {
|
||||||
await buildAllCss();
|
await events.buildAllCss();
|
||||||
await buildAllJs();
|
await events.buildAllJs();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// --------------------- custom wtach targets
|
||||||
eleventyConfig.addWatchTarget('./src/assets/**/*.{css,js,svg,png,jpeg}');
|
eleventyConfig.addWatchTarget('./src/assets/**/*.{css,js,svg,png,jpeg}');
|
||||||
eleventyConfig.addWatchTarget('./src/_includes/**/*.{webc}');
|
eleventyConfig.addWatchTarget('./src/_includes/**/*.{webc}');
|
||||||
|
|
||||||
|
|
@ -95,7 +91,7 @@ export default async function (eleventyConfig) {
|
||||||
eleventyConfig.addShortcode('image', shortcodes.imageShortcode);
|
eleventyConfig.addShortcode('image', shortcodes.imageShortcode);
|
||||||
eleventyConfig.addShortcode('year', () => `${new Date().getFullYear()}`);
|
eleventyConfig.addShortcode('year', () => `${new Date().getFullYear()}`);
|
||||||
|
|
||||||
// --------------------- Events ---------------------
|
// --------------------- Events: after build
|
||||||
if (process.env.ELEVENTY_RUN_MODE === 'serve') {
|
if (process.env.ELEVENTY_RUN_MODE === 'serve') {
|
||||||
eleventyConfig.on('eleventy.after', events.svgToJpeg);
|
eleventyConfig.on('eleventy.after', events.svgToJpeg);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
import {svgToJpeg} from './events/svg-to-jpeg.js';
|
import {svgToJpeg} from './events/svg-to-jpeg.js';
|
||||||
|
import {buildAllCss} from './events/build-css.js';
|
||||||
|
import {buildAllJs} from './events/build-js.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
svgToJpeg
|
svgToJpeg,
|
||||||
|
buildAllCss,
|
||||||
|
buildAllJs
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue