Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

How I can use real-time public path? #112

Closed
bernex opened this issue Jan 6, 2017 · 3 comments
Closed

How I can use real-time public path? #112

bernex opened this issue Jan 6, 2017 · 3 comments

Comments

@bernex
Copy link

bernex commented Jan 6, 2017

I have publicPath in APP.url variable and take it from page.

I have tried: <img src={ require("file-loader?publicPath="+APP.url+"!./del.svg") }/>
and <img src={ APP.url + require("file-loader!./del.svg") }/>

In css very simple - I can use ./ public path. With img.src it is not possible. It s relative to page url. And I can't use in my situation.

How I can solve this task? Thank you!

@AndreKR
Copy link

AndreKR commented Apr 16, 2017

You seem to be using some kind of template language, you should mention that.

Anyway, have you tried adding

__webpack_public_path__ = 'my_path';

or

__webpack_public_path__ = window.asset_root;

at the top of your entrypoint?

@alexander-akait
Copy link
Member

alexander-akait commented Jun 30, 2017

@bernex Is the problem still there? Why use use APP.url? Your can use file-loader?name=[name].[ext]&publicPath=assets/foo/&outputPath=app/images/ to configure output directory and public path instead using APP.url.

@michael-ciniawsky
Copy link
Member

Fixed by #81

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants