# Customizable Pipes (especially for JS resources)

**URL:** <https://discourse.gohugo.io/t/customizable-pipes-especially-for-js-resources/44266>\
**Category:** feature\
**Created:** [May 8, 2023, 9:11pm UTC](https://discourse.gohugo.io/t/customizable-pipes-especially-for-js-resources/44266 "2023-05-08T21:11:57Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![AlanBreck](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/alanbreck/32/11694_2.png) [@AlanBreck](https://discourse.gohugo.io/u/AlanBreck)\
**Post date:** [May 9, 2023, 4:50pm UTC](https://discourse.gohugo.io/t/customizable-pipes-especially-for-js-resources/44266/2 "2023-05-09T16:50:50Z")

</div>

Several topics that seem related:

> [@Hugo integration with js.Build (ESBuild) and multiple output files](https://discourse.gohugo.io/t/hugo-integration-with-js-build-esbuild-and-multiple-output-files/32647):
>
> {{ resources.Get "script.js" | js.Build }} uses the ESBuild api as a single entry point and expects a single output file (to pass through additional pipes). ESBuild, though, sometimes creates multiple output files from a single entry point, e.g. code splitting, external source maps, and “import \*.css” statements in javascript files. This leads to my question: how will/should Hugo handle multiple outputs from ESBuild in Hugo Pipes? Currently, Hugo already added external source maps as a develop…

> [@Compile svelte file via js.Build](https://discourse.gohugo.io/t/compile-svelte-file-via-js-build/29470):
>
> Currently with the esBuild support in Hugo 0.78.2, I was wondering can we use esBuild plugins system in Hugo which can compile svelte files into normal js files like shown [here](https://esbuild.github.io/plugins/#svelte-plugin). Simply I want Hugo to handle svelte files using js.Build.

> [@Is it possible to add plugins to ESBuild for JS in Hugo?](https://discourse.gohugo.io/t/is-it-possible-to-add-plugins-to-esbuild-for-js-in-hugo/32391):
>
> I’m trying to go for an all out Hugo modular theme, without NPM dependencies. Most of the NPM dependencies are done but I’m stuck with dependencies in which index.js imports SCSS styles like [cookieconsent/index.js at dev · osano/cookieconsent · GitHub](https://github.com/osano/cookieconsent/blob/dev/src/index.js#L3). I want Hugo to tell ESBuild to use the [esbuild-plugin-sass](https://github.com/koluch/esbuild-plugin-sass) plugin for this purpose, but I couldn’t find any mention in the Hugo docs. Would it be possible to do so, or is there some other way I can approach this?

---

_[View the full topic](https://discourse.gohugo.io/t/customizable-pipes-especially-for-js-resources/44266)._
