build: Use ES module system

- Update package.json with type
- Change eleventy config to use import and export
- Add comments for jshint and inspection
This commit is contained in:
sthag 2026-03-04 19:22:55 +01:00
parent 1db7faaf18
commit 43de7d86fa
2 changed files with 52 additions and 48 deletions

View file

@ -1,7 +1,10 @@
const {EleventyHtmlBasePlugin} = require("@11ty/eleventy"); /* jshint strict: false */
module.exports = function (eleventyConfig) { import {HtmlBasePlugin} from "@11ty/eleventy";
eleventyConfig.addPlugin(EleventyHtmlBasePlugin);
// noinspection JSUnusedGlobalSymbols
export default async function (eleventyConfig) {
eleventyConfig.addPlugin(HtmlBasePlugin);
eleventyConfig.setLiquidOptions({ eleventyConfig.setLiquidOptions({
// greedy: false, // greedy: false,
@ -82,4 +85,4 @@ module.exports = function (eleventyConfig) {
templateFormats: ['html', 'liquid', 'njk', 'md'] templateFormats: ['html', 'liquid', 'njk', 'md']
// pathPrefix: './demo/' // pathPrefix: './demo/'
}; };
}; }

View file

@ -15,6 +15,7 @@
"type": "git", "type": "git",
"url": "https://quelltext.interaktionsweise.de/interaktionsweise/hippie.git" "url": "https://quelltext.interaktionsweise.de/interaktionsweise/hippie.git"
}, },
"type": "module",
"scripts": { "scripts": {
"hello": "echo -n \"This is \" && node -p \"process.env.npm_package_name\" | tr '[:lower:]' '[:upper:]'", "hello": "echo -n \"This is \" && node -p \"process.env.npm_package_name\" | tr '[:lower:]' '[:upper:]'",
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",