#How to change BUILD assets directory?

1 messages · Page 1 of 1 (latest)

junior ether
#

Hi 👋

By default, "npm run build" creates roots for CSS and JS files as following:

/assets/index.css
/assets/main.js

How can I change it to:

assets/index.css
assets/main.js

No slash in front.

Thank in advance! 👍

jolly junco
#

You can't remove the slash, but setting base: './' should make it start with ./ which has the same effect

junior ether
#

Thank you @jolly junco 👍
It worked.

"./" what exactly does it mean?

jolly junco
#

it means relative, just a special string that Vite understands to generate paths to be relative. You can also pass "" which does the same thing.