Giter Club home page Giter Club logo

Comments (9)

alexhancock avatar alexhancock commented on August 21, 2024

(This may totally be an issue in webpack itself, I just thought I would post an issue here as the likelihood someone looking at this repo has run into this problem is higher than webpack repo itself)

from chunk-manifest-webpack-plugin.

kevinrenskers avatar kevinrenskers commented on August 21, 2024

I just created this issue: webpack/webpack#1315. Has an example as well: https://github.com/kevinrenskers/chunkhash-problem.

from chunk-manifest-webpack-plugin.

alexhancock avatar alexhancock commented on August 21, 2024

Cool - glad to see I'm not alone.

I'll follow that thread and this one to see if anyone has relevant knowledge towards cause or a fix.

from chunk-manifest-webpack-plugin.

bholloway avatar bholloway commented on August 21, 2024

+1

from chunk-manifest-webpack-plugin.

bholloway avatar bholloway commented on August 21, 2024

Is this still a pain point for others?

I found a solution that works for my use-case. I will raise a PR so @diurnalist and others can critique. But tomorrow after sleep.

from chunk-manifest-webpack-plugin.

bholloway avatar bholloway commented on August 21, 2024

So at startup WebpackOptionsApply adds a lot of default plugins. One of them is TemplatedPathPlugin, at WebpackOptionsApply.js#L266.

Noting that MainTemplate is the implementation of compilation.mainTemplate the MainTemplate.updateHashForChunk() routine will determine the hash of the entry chunk. It exposes a "hash-for-chunk" extensibility point which is hooked by TemplatedPathPlugin.

The problem is that TemplatedPathPlugin adds the hashes of other chunks into the digest. I believe this is on the presumption that the entry chunk will contain the chunk manifest. The hashing routine is not a pure function so simply adding another "hash-for-chunk" routine will not undo the effects of TemplatedPathPlugin.

I am proposing a monkey-patch of MainTemplate.updateHashForChunk() such that it does not call the "hash-for-chunk" extensibility point. This is working for my use-case (sorry closed source). I am interested whether this solves the problem for @alexhancock and @kevinrenskers.

You can install from bholloway/chunk-manifest-webpack-plugin and I have PR #9.

Additionally, let me know if this is relevant to webpack/webpack#1315.

from chunk-manifest-webpack-plugin.

bholloway avatar bholloway commented on August 21, 2024

This issue should be closed based on the response to the question I posed.

Essentially if you use webpack-md5-hash plugin the problem goes away.

Refer to webpack/webpack#1315 for a full solution.

from chunk-manifest-webpack-plugin.

gingur avatar gingur commented on August 21, 2024

Using the md5hash plugin still having an issue with naming of the chunks; PR #11

from chunk-manifest-webpack-plugin.

gingur avatar gingur commented on August 21, 2024

knock knock

from chunk-manifest-webpack-plugin.

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.