Skip to content

Preserve subdirectories for assets in webpack output  #223

@flow38

Description

@flow38

Hello,

Currently encore do not seem to handle subdirectories path for generated assets:

My project structure is:
/assets
/assets/images/
/assets/images/logo

My template use this kind of code
img src="{{ asset('build/images/image1.jpg') }}"
img src="{{ asset('build/images/logos/image2.jpg') }}"

image2.jpg loading will fail cause manifest will look like
"build/images/image1.jpg": "/build/images/image1.6f30c87b.jpg",
"build/images/image2.jpg": "/build/images/image2.6f30c87b.jpg",

I could use in my template 'build/images/image2.jpg' path bu it's totally conter intuitive and error prone.

I did not test on other kind of assets, but subdirectories path should alway take into account by encore.

I found similar issue here but don't know how to apply it to encore and as explain, solution should be apply to all kind of assets.

Thanks for you help

Florent

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions