Giter Club home page Giter Club logo

Comments (7)

fjsj avatar fjsj commented on May 20, 2024 1

No, feel free to open a PR addressing this or discussing solutions here.

from django-webpack-loader.

fjsj avatar fjsj commented on May 20, 2024

This is the expected behavior. From docs:

Please note that this approach will use the original asset file, and not a post-processed one from the Webpack pipeline, in case that file had gone through such flow (i.e.: You've imported an image on the React side and used it there, the file used within the React components will probably have a hash string on its name, etc. This processed file will be different than the one you'll grab with webpack_static).

To solve this for your use case, you need to drop the hash on your assetModuleFilename, that's what webpack docs suggest: https://webpack.js.org/guides/asset-modules/#custom-output-filename.

So change assetModuleFilename from "images/[name].[contenthash][ext]", to "images/[name].[ext]",

I'll keep this one open and close the other duplicate issues.
Sorry for this, but we don't have a solution that supports hashes yet.

from django-webpack-loader.

em1le avatar em1le commented on May 20, 2024

Hey fellow developers any update on the subject ?

from django-webpack-loader.

em1le avatar em1le commented on May 20, 2024

I'll let you know once I'll figure out something. Thanks for your reactivity btw

from django-webpack-loader.

batistadasilva avatar batistadasilva commented on May 20, 2024

Hello everyone

I suggest the following approach for adressing this issue with Webpack 5:

  1. Add original source file paths of asset resources to webpack-stats.json
    django-webpack/webpack-bundle-tracker#125
  2. Create the webpack_asset template tag that handles transformed files URLs
    #397

@fjsj What do you think?

from django-webpack-loader.

fjsj avatar fjsj commented on May 20, 2024

Thanks for the contribution @batistadasilva !
I'm excited to merge this, but please check PR comments.

from django-webpack-loader.

batistadasilva avatar batistadasilva commented on May 20, 2024

@fjsj Thanks for the review!

from django-webpack-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.