You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to set up aliases and try to use them inside html, but they don't seem to work for html files by default. When trying to use an alias in js or scss, the path in the browser changes (although it doesn't always happen), but an error appears in html with the path unchanged localhost/@/scripts/about.js .
Example in src/pages/about.html
<h2>Body of About</h2>
<script type="module" src="@/scripts/about.js"></script>
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to set up aliases and try to use them inside html, but they don't seem to work for html files by default. When trying to use an alias in js or scss, the path in the browser changes (although it doesn't always happen), but an error appears in html with the path unchanged
localhost/@/scripts/about.js
.Example in src/pages/about.html
Another example with an error in src/js/main.js
What is used:
My folder structure:
Details
My vite.config.js
Beta Was this translation helpful? Give feedback.
All reactions