1
1
'use strict' ;
2
2
3
- const { EleventyRenderPlugin} = require ( '@11ty/eleventy' ) ;
4
- const {
3
+ import { EleventyRenderPlugin } from '@11ty/eleventy' ;
4
+ import {
5
5
absoluteUrl ,
6
6
convertHtmlToAbsoluteUrls ,
7
7
dateToRfc3339 ,
8
8
getNewestCollectionItemDate ,
9
- } = require ( '@11ty/eleventy-plugin-rss' ) ;
10
- const syntaxHighlight = require ( '@11ty/eleventy-plugin-syntaxhighlight' ) ;
11
- const yaml = require ( 'js-yaml' ) ;
9
+ } from '@11ty/eleventy-plugin-rss' ;
10
+ import syntaxHighlight from '@11ty/eleventy-plugin-syntaxhighlight' ;
11
+ import * as yaml from 'js-yaml' ;
12
12
13
- const componentsPlugin =
14
- require ( './source/helpers/components/index.ts' ) . default ;
15
- const datesPlugin = require ( './source/helpers/dates.ts' ) . default ;
16
- const { liquidEngine, markdownEngine} = require ( './source/helpers/engines.ts' ) ;
17
- const pagesPlugin = require ( './source/helpers/pages.ts' ) . default ;
18
- const typePlugin = require ( './source/helpers/type.ts' ) . default ;
19
- const functionPlugin = require ( './source/helpers/function.ts' ) . default ;
13
+ import componentsPlugin from './source/helpers/components/index.ts' ;
14
+ import datesPlugin from './source/helpers/dates.ts' ;
15
+ import { liquidEngine , markdownEngine } from './source/helpers/engines.ts' ;
16
+ import pagesPlugin from './source/helpers/pages.ts' ;
17
+ import typePlugin from './source/helpers/type.ts' ;
18
+ import functionPlugin from './source/helpers/function.ts' ;
20
19
21
- /** @param {import('@11ty/eleventy').UserConfig } eleventyConfig */
22
- module . exports = eleventyConfig => {
20
+ /**
21
+ * @param {import('@11ty/eleventy').UserConfig } eleventyConfig
22
+ * @returns {void }
23
+ */
24
+ export default function ( eleventyConfig ) {
23
25
eleventyConfig . addPassthroughCopy ( 'source/assets/dist' ) ;
24
26
eleventyConfig . addPassthroughCopy ( 'source/assets/img' ) ;
25
27
eleventyConfig . addPassthroughCopy ( 'source/favicon.ico' ) ;
@@ -35,10 +37,10 @@ module.exports = eleventyConfig => {
35
37
eleventyConfig . setLibrary ( 'liquid' , liquidEngine ) ;
36
38
eleventyConfig . setLibrary ( 'md' , markdownEngine ) ;
37
39
eleventyConfig . addDataExtension ( 'yml, yaml' , contents => yaml . load ( contents ) ) ;
38
- eleventyConfig . addDataExtension ( 'ts' , {
39
- parser : filepath => require ( filepath ) ,
40
- read : false ,
41
- } ) ;
40
+ // eleventyConfig.addDataExtension('ts', {
41
+ // parser: filepath => import (filepath),
42
+ // read: false,
43
+ // });
42
44
43
45
// register filters and shortcodes
44
46
eleventyConfig . addPlugin ( componentsPlugin ) ;
@@ -75,4 +77,4 @@ module.exports = eleventyConfig => {
75
77
layouts : '_layouts' ,
76
78
} ,
77
79
} ;
78
- } ;
80
+ }
0 commit comments