have an ability to specify "base directory"
Clear and concise description of the problem
currently if you build histoire in the index.html for example it has lines of code like , if for instance you want to host his as a sub directory on the same domain it currently breaks.
so for instance if you want to host your histoire on a url like /stories it will look for the above stylesheet in /assets instead of /stories/assets
Suggested solution
add a config property "base url". that allows this to be hosted as a sub domain which will append this value to the base directory.
so with a base url value of "/stories" the still import above becomes /stories/assets/style instead of /assets/style
Alternative
No response
Additional context
No response
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.
I think this is already possible. You can set a base path in the vite config, for example in the histoire.config.js:
import { defineConfig } from 'histoire';
export default defineConfig({
vite: {
base: '/stories/',
},
});
@theDevelopper that would be for the entire file. This would work if you are making a UI lib. But not if you have a base project that also makes use of historie. So ideally the historie build should have its own base path
@jpengelbrecht Yes, I do understand that. that's why you can override the base path in the histoire.config.js instead of the project's vite.config.js, as shown in my example. This way the base path is applied to Histoire and not the project itself.
At least in my project that works as expected.