Compare commits

...

2 Commits

Author SHA1 Message Date
Tommi 2191616124 import the right JavaScript file in HTML 2023-03-22 10:12:39 +01:00
Tommi 28d9eb00d9 fix output extension problem 2023-03-22 10:12:22 +01:00
2 changed files with 4 additions and 4 deletions

View File

@ -108,16 +108,16 @@ module.exports = function(eleventyConfig) {
let output = await require('esbuild').build({
target: 'es2022',
entryPoints: [inputPath],
minify: true,
bundle: true,
write: false,
});
return async () => {
console.log('processing js');
console.log(output.outputFiles[0].text);
return output.outputFiles[0].text;
}
},
compileOptions: {
permalink: (contents, inputPath) => (data) => data.page.filePathStem + '.js',
}
});

View File

@ -32,6 +32,6 @@
{% render 'footer.html', lang: lang %}
</div>
<script src='/index.js' type='module'></script>
<script src='/js/index.js' type='text/javascript'></script>
</body>
</html>