Code Monkey home page Code Monkey logo

Comments (4)

jantimon avatar jantimon commented on June 23, 2024

That's a great feature request - don't know right now how we could implement it.
The information is in the compilation variable in https://github.com/jantimon/resource-hints-webpack-plugin/blob/master/index.js#L54
But how could a good configuration syntax look like?

from resource-hints-webpack-plugin.

omichelsen avatar omichelsen commented on June 23, 2024

Would it be too confusing to just list the name of the bundles like so:

prefetch: ['bundlea', 'bundleb'],

Of course there could be some overlap with files, but that could be solved by checking both?

from resource-hints-webpack-plugin.

jantimon avatar jantimon commented on June 23, 2024

Right now a string would add the string to allow adding images or fonts

from resource-hints-webpack-plugin.

chrisui avatar chrisui commented on June 23, 2024

So I've come to use this plugin but the only assets which are passed through are only those chunks which are already used for that page and nothing else.

Ie.

<link rel="prefetch" href="vendor.js">
<link rel="prefetch" href="main.js">
<script src="vendor.js"></script>
<script src="main.js"></script>

I kinda feel like I'm doing something wrong since this seems kinda redundant? The list referenced in the source seems to just be the scripts which are rendered into the body.

Anyway.

Why not just use Object.keys(compilation.assets) in the plugin to allow people to reference and prefetch/preload any of the assets which are output by the webpack compilation?

from resource-hints-webpack-plugin.

Related Issues (11)

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.