Create javascript bundle

This commit is contained in:
TheThomaas 2025-05-01 17:11:26 +02:00
parent 8a3940b966
commit 779f447c13
3 changed files with 8 additions and 7 deletions

View file

@ -5,8 +5,6 @@ import eleventyPDF from "./_config/eleventy-plugin-pdf.js";
export default async function (eleventyConfig) { export default async function (eleventyConfig) {
eleventyConfig.setUseGitIgnore(false); eleventyConfig.setUseGitIgnore(false);
eleventyConfig.addPassthroughCopy({"./src/_includes/js/" : "/js"});
eleventyConfig.addLayoutAlias('base', 'layouts/base.html'); eleventyConfig.addLayoutAlias('base', 'layouts/base.html');
eleventyConfig.addLayoutAlias('pdf', 'layouts/pdf.html'); eleventyConfig.addLayoutAlias('pdf', 'layouts/pdf.html');
@ -27,16 +25,16 @@ export default async function (eleventyConfig) {
return [...collection.getFilteredByGlob('./src/experiences/*.md')] return [...collection.getFilteredByGlob('./src/experiences/*.md')]
.sort((a, b) => a.data.startDate - b.data.startDate).reverse(); .sort((a, b) => a.data.startDate - b.data.startDate).reverse();
}); });
eleventyConfig.addPlugin(eleventyPDF);
eleventyConfig.addPassthroughCopy('src/favicon.ico') eleventyConfig.addPassthroughCopy('src/favicon.ico')
eleventyConfig.addPlugin(eleventyPDF);
eleventyConfig.addPlugin(pluginIcons, { eleventyConfig.addPlugin(pluginIcons, {
sources: [{ name: 'lucide', path: 'node_modules/lucide-static/icons', default: true }] sources: [{ name: 'lucide', path: 'node_modules/lucide-static/icons', default: true }]
}); });
eleventyConfig.addBundle("css"); eleventyConfig.addBundle("css");
eleventyConfig.addBundle("js");
return { return {
markdownTemplateEngine: 'liquid', markdownTemplateEngine: 'liquid',

View file

@ -29,6 +29,9 @@
{% include "partials/footer.liquid" %} {% include "partials/footer.liquid" %}
<script src="/js/main.js"></script> {% js %}
{% include "js/main.js" %}
{% endjs %}
<script src="{% getBundleFileUrl "js" %}"></script>
</body> </body>
</html> </html>