We have this code in the main.js to import configuration variables:

import * as config from '/config/settings.js'
app.config.globalProperties.apiUrl = apiUrl
app.config.globalProperties.imageBaseUrl = imageBaseUrl

and exclude the config/settings.js by setting in external in vite.config.js

Which work splendidly in the build version

Wenn run in a npm run dev local server the import line is error messaged as:

[vite] Internal server error: Cannot import non-asset file /config/settings.js which is inside /public. JS/CSS files inside /public are copied as-is on build and can only be referenced via or in html. If you want to get the URL of that file, use /config/settings.js?url instead.

If included in the index.html with`

    <script type="module" src="/config/settings.js"></script>

Before the inclusion of main.js the exports are not available.

How do make the import of external configuration work during development?