Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 851 Bytes

static-assets.md

File metadata and controls

25 lines (18 loc) · 851 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, {{BASE_URL}}:

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

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