-
I want to change my resource import path through base, it can be a bit complicated. This is the path I want. <script type="module" crossorigin src="./foo/assets/xxxx.js"></script>
<link rel="stylesheet" crossorigin href="./foo/assets/xxxx.css"> I want to achieve this through the following configuration. export default defineConfig({
base: './foo/',
}) But the console gives me a warning not an invalid path And the output isnot i want. The result after the build was not what I wanted. Is there any way to ignore this warning and force the output I want? https://stackblitz.com/edit/vitejs-vite-1uvr1z?file=dist%2Findex.html |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you would like to see |
Beta Was this translation helpful? Give feedback.
If you would like to see
foo
in the paths, you have to use an absolute base like/foo/
. When you use a relative base (./
), the paths will be relative between your resources so you don't need to specify any folder, it would depend on your dist structure. If you have for example your assets in afoo
folder, that will be added automatically (in case you configured foo in assetFileNames)