Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 894 Bytes

static-assets.md

File metadata and controls

26 lines (20 loc) · 894 Bytes
layout title
default
Static Assets

Using static assets

To use static assets (such as images) with your component, simply include them anywhere within your project folder. For example:

├── ...
└── jane-doe/
    └── hello-famous/
        ├── hello-famous.js
        └── my-image.jpg

Then, within your hello-famous.js entrypoint file, you can refer to that asset using special syntax for asset interpolation, {% raw %}{{BASE_URL}}{% endraw %}:

{% raw %} FamousFramework.component('jane-doe:hello-famous', { tree:<node id="imageNode"> <img src="{{BASE_URL}}my-image.png"> </node> }); {% endraw %}

Refer to famous-tests:static-assets for a working example of this concept.