Publish Vue/Vitesse/Vite to sub sub folder on IIS

I have an old ASP.Net app and I want to run a Vue 3 app under it.

In production, it would be something like:
http://www.some-domain.com/some-app/vue

some-app is the ASP.Net app.
It could be anything for some-domain and some-app (ie users can install the app onto any domain/url)

When I compile Vue for production and navigate to the /vue folder, I see the index page, but Vue is looking for the Assets in the root at localhost.
But it looks like some of the CSS loaded(?)
That’s when not using anything for the “base” property in my vite.config.ts

If I use base: '' and then navigate to the vue folder, I’m getting the app’s 404 page and console says it’s looking for an image in the root.

If I use base: '/vue' and then navigate to the vue folder, I see the html, but no CSS or anything is loading.
Console shows this error about the app.****.js file:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html

I checked the mime type for *.js in IIS and it is set to “application/javascript”

I feel like I’ve tried all variations for “base” in my vite.config.ts but still can’t get it.

I just need everything created in the “dist” production folder to be relative to that folder and disregard any folder/path above that.

So that using this URL: http://www.some-domain.com/some-app/vue
The content of “dist” is the vue folder and Vue to see that as the root and not look in “some-app” or “some-domain”.

I saw an earlier post where “some-app” is known and constant, but in my case that is not an option…my Vue app will always be at least 2 levels in from the root domain.

Hope that makes sense. Please let me know if you need any additional information.

Thanks in advance!

base should be "/some-app/vue/", but that will only work if the URL actually is "/some-app/vue/". The some-app part can’t be dynamic. Why do you need that to be dynamic?

One solution might be that you hardcode base to be "/vue/", and that you configure IIS to map "/some-app/vue/" to "/vue/"? When you configure IIS like that, I imagine you can tall it that the some-app` part can be dynamic (anything).

Thanks for the help @PeppeL-G

Why do you need that to be dynamic?

the way we sell our app, we allow the clients to install the app any where they choose on their domain
so one client might be:
http://www.domain1.com/appname/
another might be:
http://bananas.domain2.com/
or
http://www.domain3.com/oranges/
etc.

We don’t have access to all our clients’ IIS so configuring IIS isn’t an option either. :frowning_face:

I found this on the Vite site yesterday about different base options but I don’t understand it and it’s listed as “experimental”. I’m going to try to play with that to see if I can figure something out.

…it seems like keeping everything relative should be the easiest way to manage the routes, but I guess not…

Thanks again!
Any other suggestions would be GREATLY appreciated!

The documentation for base mentions “embedded deployment”. I’m not sure what that is, but maybe that’s for your use-case. I know you’ve tried the value '', but try './', and see if that works better.

However, if you use Vue Router with real URLs instead of just changing the hash part of the URL, you have to configure IIS, otherwise sending links and bookmarking won’t work.