Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: ESBuild pipeline #7321

Closed
earthboundkid opened this issue May 26, 2020 · 4 comments · Fixed by #7473
Closed

Feature request: ESBuild pipeline #7321

earthboundkid opened this issue May 26, 2020 · 4 comments · Fixed by #7473

Comments

@earthboundkid
Copy link
Contributor

earthboundkid commented May 26, 2020

ESBuild is a very fast JavaScript bundler written in Go. It would be nice if in addition to minifying out of the box, Hugo could also bundle JS files.

Usage might looks like:

{{ $jsOptions := dict "minify" true "sourceMap" false "module" true }}
{{ $js := resources.Get "js/entrypoint.js" | toJSBundle $jsOptions | fingerprint }}
<script type="module" src='{{ $js.RelPermalink }}'></script>

And entrypoint.js could import files in the ES6 style:

import { onLoad } from './utils.js';
import myFunc from './my-func.js';

onLoad(myFunc);

With all the concatenation and tree shaking happening automatically.

@bep bep added this to the v0.72 milestone May 26, 2020
@bep
Copy link
Member

bep commented May 26, 2020

See evanw/esbuild#152

@bep
Copy link
Member

bep commented May 26, 2020

How did that project get under my radar? Oh, well, hope the Hugo boss accepts this proposal.

@earthboundkid
Copy link
Contributor Author

I thought you were the Hugo boss? If it's not you, then is it him?

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants