steal-tools
steal-tools copied to clipboard
Slim loader relative bundle paths
steal-tools writes out config like these to progressive load bundles:
global.steal.paths = {
"316": "dist/bundles/bitballs/index.js",
"317": "dist/bundles/bitballs/index.css",
"318": "dist/bundles/404-component-de-b096d349.js",
"319": "dist/bundles/details-details--87019b0a.js"
};
One thing I found is that, the code to load the bundles break when the url is other that root, because the paths are relative. Two options come to mind to fix this:
a) Make it so steal-tools writes out absolute paths
b) Change the loader so it adds /
to the start of the path.
I like a) because that means we won't have to adjust plugins (like css) to deal with the relative paths, but I'm not 100% sure that's the right™ solution.
Thoughts @matthewp?
Does it work if you use the
The base tag
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
It does work, but I had to add the <base href="/">
to the index.stache
used as main.
done-autorender
removes it from the head if I make the loader inject the tag (or if I add the tag to my prod.html
page)
Is it ok to ask users to add the base
tag if they run into issues or should we make it automagic somehow?
steal.production.js has the same issue. I'm not sure... is it automagic there some how? I don't think that it is...
@m-mujica Didn't you fix this?
@matthewp I don't think so. I did work in a bundle path issue but it was about css bundles with custom dest
https://github.com/stealjs/steal-tools/pull/1000