# Ideas with using "get\_asset\_url" during local development?

**URL:** <https://community.hubspot.com/t/ideas-with-using-get-asset-url-during-local-development/78814>\
**Category:** CMS Development\
**Tags:** local-development, css\
**Created:** [April 5, 2023, 8:34pm UTC](https://community.hubspot.com/t/ideas-with-using-get-asset-url-during-local-development/78814 "2023-04-05T20:34:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MNick2](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mnick2/32/58551_2.png) [@MNick2](https://community.hubspot.com/u/MNick2)\
**Post date:** [April 5, 2023, 8:34pm UTC](https://community.hubspot.com/t/ideas-with-using-get-asset-url-during-local-development/78814/1 "2023-04-05T20:34:15Z")

</div>

Was curious how people manage developing templates and themes locally and because we have to use something like “get\_asset\_url” for everything (css/images etc). I find myself not using that until I’m done developing so I can preview my stuff locally, and then when I am ready to upload to Hubspot I’ll replace with “get\_asset\_url” but then if we need to make changes again, I have to remove “get\_asset\_url” and relative path back on my local machine to keep working properly ie “assets/main.css” since “get\_asset\_url” obviously won’t render the local css.

I was wondering how people handle this, maybe some kind of script that adds “get\_asset\_url” to all assets before uploading etc.

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [April 6, 2023, 8:28pm UTC](https://community.hubspot.com/t/ideas-with-using-get-asset-url-during-local-development/78814/2 "2023-04-06T20:28:06Z")

</div>

Hi, @MNick2 👋 Thanks for reaching out. Let’s invite some community members into the conversation — hey @BarryGrennan @Anton @LucBenayoun, can you share how you are handling this in your current workflow?

Thank you very much! — Jaycee

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [April 17, 2023, 10:34am UTC](https://community.hubspot.com/t/ideas-with-using-get-asset-url-during-local-development/78814/3 "2023-04-17T10:34:07Z")

</div>

Hey @MNick2,

most times I don’t use “get\_asset\_url” while developing modules/templates.

My personal approach is:  
creating a single CSS file with static code which defines the default state of a module or function, combine them all in a main.css like

```lia-code-sample
{% include '../css/globals/forms.css' %}
{% include '../css/globals/typo.css' %}
{% include '../css/modules/socials.css' %} 
... ​

```

I include it via “get\_asset\_url” in the layout.html file like this

`{{ require_css(get_asset_url('../../css/main.css')) }}`

so only relative paths.

Also a big thing: While developing I have the “hs watch” function running constantly in VSCode. The watcher is uploading every change to a developer portal and I’m checking/debugging everything there. Once the development is done I upload it to the clients portal.

If I need a script or (CSS) file specifically for one module I include it via the meta.json file of a module like this

```lia-code-sample
"js_assets": [
{ 
"autoload": false, 
"path": "../../../js/swiper.js", 
"name": "swiper.js", 
"defer": true 
} 
]

```

hope that helps.

best,

Anton

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [April 21, 2023, 4:43pm UTC](https://community.hubspot.com/t/ideas-with-using-get-asset-url-during-local-development/78814/4 "2023-04-21T16:43:15Z")

</div>

Thank you, @Anton!
