Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative Paths Changed to Absolute From Root #46

Closed
homestar9 opened this issue Feb 3, 2023 · 3 comments
Closed

Relative Paths Changed to Absolute From Root #46

homestar9 opened this issue Feb 3, 2023 · 3 comments

Comments

@homestar9
Copy link
Contributor

homestar9 commented Feb 3, 2023

@jclausen Possibly related to #45

If you use mix.modules() to process assets in a sub module, and the SCSS reference images using relative paths, the final .css file will use incorrect URLs.

// Original SCSS in modules_app/myModule/resources/assets/scss/
body {
 background-image: url( "../img/landscape-2.jpg" );
}
// Final CSS in modules_app/myModule/includes/css
body {
  background-image: url(/includes/images/landscape-2.jpg); <-- Wrong URL. Relative URL should be preserved

I created a simple example using the coldbox-elixir template as a simple starting point. To replicate do the following:

  1. Download my repo example
  2. npm i
  3. npm run dev

Look at the CSS in the modules_app/includes/css/ folder. You will also notice the images aren't copied over. I would have expected them to be copied over to modules_app_includes/img/ to follow the convention and mirror resources/assets/img.

@homestar9
Copy link
Contributor Author

@jclausen are you able to replicate this? I've been struggling with this for a while but haven't been able to get relative links in submodules working.

I've tried messing with the config for css-loader and resolve-url-loader but the resulting css file always points to /includes/ which is not correct.

@homestar9
Copy link
Contributor Author

Summarized in #47

jclausen added a commit that referenced this issue Feb 22, 2023
@jclausen
Copy link
Collaborator

This should be resolved in v4.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants