-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add baseUrl to a importmap() #173
Comments
Is there a way to provide a base URL when using importmap? I suspect this to be more a Symfony feature request rather than a Stenope one |
Not that I know of. Can you point to where in your code the links are created? Your code IS working as expected for the web page links, just not for the assets. I think the issue is best fixed in Stenope, since --base-url is being passed into your build command. The asset links are probably generated differently than the embedded HTML page links. For production, the assetmapper files exist on disk, so it's just a simple path (in dev, there's some magic that maps the asset routes). That's why I think the baseUrl needs to be added in stenope. I can provide a very simple demo repo if that's helpful. |
I'm not used to the AssetMapper yet. That's why I'm wondering how could Stenope communicate the baseURL to generate the proper links when using importmap? Where should we hook? For routing ( Lines 186 to 189 in 4ff235c
What would be the equivalent for generating the proper importmap? |
Thanks. AssetMapper 6.4 is marked as experimental, but will be stable in 6.4. I'll add this as an issue, as it does seem like baseUrl should be honored there, too. Can we keep this open until it's functional? I've been playing around with the steno-skeleton, trying to remove webpack and replace it with AssetMapper. It'll be very cool when it's done! |
It seems to me the default asset package is used to render the |
Should work using 6.4 at least : symfony/symfony#52561 With: assets:
base_urls: https://stenopephp.github.io/skeleton/ and with assets:
base_path: /skeleton Please note this : symfony/symfony#52561 (comment) |
See StenopePHP/skeleton#2 for skeleton upgrade to the asset mapper |
To experiment with asset mapper & stenope, according to StenopePHP/Stenope#173 issue. Also, this will be the future of assets handling with Symfony, no more bundler implied : symfony/demo#1449 (comment)
Closing as resolved, using Symfony 6.4/7.0 |
Symfony's importmap() function generates
when there's a base url, though, those routes need to be prefixed, like the path() commands.
I use this to publish to github pages:
bin/console -e prod stenope:build ./docs --base-url /micro-calendar/
https://tacman.github.io/micro-calendar/fullcalendar/
I've hacked around this problem by embedding my app.js in the HTML itself, but obviously it'd be better if the generator tweaked the paths.
Thanks.
The text was updated successfully, but these errors were encountered: