Open Arvind6353 opened 3 years ago
We tried to use setAssetPath
in this sandbox app, but to no avail. Currently our workaround here is to configure webpack, so that it copies all assets to the public/assets/
folder, served under /assets/
, where the stencil components look for them by default. However, this only works for components used on the base path (/) of the application. If we navigate to a different path, the assets are fetched relatively to that path and we end up 404s.
We tried to use import { setAssetPath } from 'our-lib/dist/components'
and use the function to change the default behaviour, but it didn't seem to have any effect.
Hi,
I have a static asset and to use in the consuming app , I need to use setAssetPath as per the docs .
I see that react binding component is not exporting setAssetPath.
Can you please help fix this.
import { MyComponent} from "fw-design-react";
fw-design-react is the react binding wrapper generated using
As per the docs , setAssetPath is imported from the `import { defineCustomElements, setAssetPath } from 'my-library/dist/custom-elements';
setAssetPath(document.currentScript.src); defineCustomElements();`
https://stenciljs.com/docs/custom-elements
@splitinfinities @liamdebeasi