Code Monkey home page Code Monkey logo

Comments (2)

faceyspacey avatar faceyspacey commented on June 27, 2024

That doesn't seem too hard. I don't use it. It's probably best in userland. It seems if you just have an array of chunkNames (which I can return in the final return as a minor change), you can use just the returned stylesheets and scripts and construct the <script /> and <link /> strings yourself by using each chunk name to get the integrity value from stats.compilation.assets[mainAssetName].integrity.

I.e. to create something like this:

<link
     rel="stylesheet"
     href="<%= htmlWebpackPlugin.files.css[index] %>"
     integrity="<%= htmlWebpackPlugin.files.cssIntegrity[index] %>"
     crossorigin="<%= webpackConfig.output.crossOriginLoading %>"
  />

And of course the crossOriginLoading it seems you will already know.

If you're using Webpack "magic comments" (or require.ensure with the chunkName argument) and React Universal Component you will in fact already have the chunk names for all dynamic chunks, and you should know the chunk names for named entry points.

Perhaps that solves your problem for now. You can use the flushFiles Low-level API to achieve this.

from webpack-flush-chunks.

faceyspacey avatar faceyspacey commented on June 27, 2024

I'm just gonna close this cuz I'm cleaning house and likely won't be able to prioritize it.

from webpack-flush-chunks.

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.