Replies: 3 comments 4 replies
-
|
Beta Was this translation helpful? Give feedback.
1 reply
-
My solution for now is to modify my rails template and replace |
Beta Was this translation helpful? Give feedback.
3 replies
-
Here's my solution with webpack's built in asset handling: rails/webpacker#2956 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a Rails 6 application using webpack (through webpacker) and I moved to webpack 5. I have issues around generating the correct file path for the image assets.
It's investigated in rails/webpacker#2956
The webpack configuration uses the webpack-assets-manifest plugin to generate a manifest file with the proper filenames so the Rails template are finding the proper generated asset file. The manifest files maps the source file to the destination file.
My app file structure as as below:
I have a file at
app/webpack/images/flags/en.svg
that I would like to generate inpublic/packs/media/images/flags/601fdab623a59f2a2c9a.svg
. Theflags/
directory is especially important for me because the webpack-assets-manifest plugin uses the asset generated path to determine which relative source path to use. The actual source path is lost because paths are relative to application root directory and not toapp/webpack/images/
.My webpack configuration contains:
With this, my
en.svg
flag is generated at/packs/media/images/app/webpack/images/flags/601fdab623a59f2a2c9a.svg
.How to make the
[path]
substitution in thegenerator.filename
rule configuration equal toflags/
(and notapp/webpack/images/flags/
as currently)?Thank you
Beta Was this translation helpful? Give feedback.
All reactions