mirror of
https://github.com/Hopiu/djLint.git
synced 2026-03-19 06:40:24 +00:00
31 lines
745 B
JavaScript
31 lines
745 B
JavaScript
const esbuild = require('esbuild');
|
|
const generateContentHash = require('../lib/generate-content-hash.js');
|
|
|
|
module.exports = class {
|
|
data() {
|
|
return {
|
|
permalink: `/static/js/${generateContentHash(
|
|
'src/static/js/**/*.js',
|
|
)}.js`,
|
|
eleventyExcludeFromCollections: true,
|
|
};
|
|
}
|
|
|
|
async render() {
|
|
await esbuild.build({
|
|
entryPoints: ['src/static/js/hamburger.js'],
|
|
inject: [
|
|
'./src/static/js/animate.js',
|
|
'./src/static/js/modal.js',
|
|
'./src/static/js/tabs.js',
|
|
],
|
|
bundle: true,
|
|
minify: true,
|
|
outfile: `_site/static/js/${generateContentHash(
|
|
'src/static/js/**/*.js',
|
|
)}.js`,
|
|
sourcemap: false,
|
|
target: 'es5',
|
|
});
|
|
}
|
|
};
|