updated to 6.3.2 - however image paths in SASS like background-image:url(../../images/wave-green.svg);
still can not be resolved when running build
.
Setup:
- bud.js 6.3.2
- windows 11
- WSL2 (Ubuntu)
- URLs
http://localhost/example/
and/orhttp://example.localhost/
Sidenote: if using sage10, I do not have this issue when building.
I am not using @src or @images because this does not seem to work for me for some reason. Do i need to use aliases for this to work with Bud consistently?
file structure in a nutshell is the following:
– …
–dist
– src
– --fonts
– --images
– --styles
– --scripts
– bud.config.js
– index.php
it always seems to add “components” infront. Module not found: Error: Can't resolve './components/@source/src/images/wave-red.svg' in './src/styles'
Not sure if this is just displayed, or actually what it’s looking for.
–
Using .setPublicPath()
i get the following results with different paths (command npm run dist
):
-
/
=>https://example.com/css/<file>
-
/wp-content/themes/example/dist/
=>https://example.com/wp-content/themes/example/dist/wp-content/themes/example/dist/css/<file>
- “” (empty string) =>
https://example.com/wp-content/themes/example/distcss/<file>
-
../
=>https://example.com/wp-content/themes/example/dist../css/<file>
-
./
=>https://example.com/wp-content/themes/example/dist./css/<file>
Any other things I can try?
Running yarn dev
with HMR actually works. So it’s surprising that it does not work when built.