# Steal build path for bundleAsset

**URL:** <https://forums.bitovi.com/t/steal-build-path-for-bundleasset/799>\
**Category:** StealJS\
**Created:** [January 24, 2018, 2:16pm UTC](https://forums.bitovi.com/t/steal-build-path-for-bundleasset/799 "2018-01-24T14:16:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fp\_dev](https://avatars.discourse-cdn.com/v4/letter/f/13edae/32.png) [@fp\_dev](https://forums.bitovi.com/u/fp_dev)\
**Post date:** [January 24, 2018, 2:16pm UTC](https://forums.bitovi.com/t/steal-build-path-for-bundleasset/799/1 "2018-01-24T14:16:32Z")

</div>

Hi everybody,  
I’m developping an application with steal+canjs (v3).  
It’s a standard application with canjjs components and npm modules.  
I would like to add the **`img`** directory (that will hold image shared across different components), to my production build (i’m thinking about a possible application in cordova), so I added the following building option to my build script:

```
var stealConfig = {
    main: "index",
    config: __dirname+"/../package.json!npm"
};

var buildOptions = {
    bundleSteal:true,
    dest: __dirname+"/../dist/",
    bundleAssets: {
        infer: false,
        glob:["img/**/*"]
    }
};

stealTools.build(stealConfig, buildOptions);

```

My directory tree, in development, is the following:

```
├── buildScripts
│ └── build.js
├── component
│ ├── mainPage
│ │ ├── (mainPage modlet files)
│ └── login
│ ├── (login modlet files)
├── img
│ ├── logo.png
│ ├── 01.png
│ ├── 02.png
├── index.css
├── index.html
├── index.js
├── index.stache
├── node_modules
│ ├── ... (list of modules)
├── package.json

```

and the building process, correctly, generate the following building “object”:

`├── dist`  
`│ ├── bundles`  
`│ │ ├── component`  
`│ │ ├── index.css`  
`│ │ ├── index.js`  
`│ │ └── mainpage-login.js`  
`│ ├── img`  
`│ │ └── logo.png`  
`│ │ └── 01.png`  
`│ │ ├── 02.png`

Here comes my issues with paths: when I want to include the image in a component, I use the following in my stache components files:

`<img src={{joinBase("/img/01.png")}} />`

But, since during the build process, the `img` directory is added under the `dest` ( **dist** ) folder, the reference path of the image will change in **dist** /img/01.png. Is there any way to handle this dynamically?  
or maybe am I using the **bundleAsset** option not in the correct way to bundle the **img** directory and data?

Thank a lot for the support!

---

<div class="post-metadata">

**Author:** ![chasen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/chasen/32/402_2.png) [@chasen](https://forums.bitovi.com/u/chasen)\
**Post date:** [January 26, 2018, 6:57pm UTC](https://forums.bitovi.com/t/steal-build-path-for-bundleasset/799/2 "2018-01-26T18:57:14Z")

</div>

Hey @fp_dev, your setup looks right; the assets will be copied to the `dest` folder, so `joinBase` will give you paths to that folder.

Is that not what you want? Or are you trying to change the paths in some other way?

---

<div class="post-metadata">

**Author:** ![fp\_dev](https://avatars.discourse-cdn.com/v4/letter/f/13edae/32.png) [@fp\_dev](https://forums.bitovi.com/u/fp_dev)\
**Post date:** [January 27, 2018, 7:16pm UTC](https://forums.bitovi.com/t/steal-build-path-for-bundleasset/799/3 "2018-01-27T19:16:31Z")

</div>

Hey @chasen,

Thank you for your reply!  
There was a little mistache in my code…  
I should write `<img src={{joinBase("img/01.png")}} />` ( the path was wrong because there was a / in from of the img). Now it works nice!

I’m will try to build the project with steal-cordova now.

I wonder if there is something to take into account in cordovaBuild options since the reference path will be different (file://android-asset/). I will go back after some attempts.  
Thank you!
