# Do not execute js code during development

**URL:** <https://discourse.gohugo.io/t/do-not-execute-js-code-during-development/55345>\
**Category:** support\
**Created:** [July 17, 2025, 9:35am UTC](https://discourse.gohugo.io/t/do-not-execute-js-code-during-development/55345 "2025-07-17T09:35:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dodedov](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dodedov/32/24270_2.png) [@dodedov](https://discourse.gohugo.io/u/dodedov)\
**Post date:** [July 17, 2025, 9:35am UTC](https://discourse.gohugo.io/t/do-not-execute-js-code-during-development/55345/1 "2025-07-17T09:35:19Z")

</div>

Hello! Let’s assume we need to develop through the Hugo server. The website has js scripts, for instance maps, chats, and similar things. This slows down the editor.

But commenting out the js code before each development is inconvenient and time-consuming.

Is there a solution to not execute js code during development?

---

<div class="post-metadata">

**Author:** ![chrillek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrillek/32/19797_2.png) [@chrillek](https://discourse.gohugo.io/u/chrillek)\
**Post date:** [July 17, 2025, 9:51am UTC](https://discourse.gohugo.io/t/do-not-execute-js-code-during-development/55345/2 "2025-07-17T09:51:41Z")

</div>

> [@](#):
>
> Is there a solution to not execute js code during development?

If you include it in your site, it will be executed. If you don’t want to include it, see

> **[hugo.IsProduction](https://gohugo.io/functions/hugo/isproduction/#article)**
>
> Reports whether the current running environment is "production".

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [July 17, 2025, 10:07am UTC](https://discourse.gohugo.io/t/do-not-execute-js-code-during-development/55345/3 "2025-07-17T10:07:32Z")

</div>

Other Posibilities

To be able to do development builds with or without JavaScript:

define a special [Environment](https://gohugo.io/quick-reference/glossary/#environment) ‘NoScript’ and test via [hugo.Environment](https://gohugo.io/functions/hugo/environment/).  
Use `hugo server --environment NoScript` in that case

another option would be to disable javascript in your browser for “[http://localhost:1313/](http://localhost:1313/)”
