Coder Social home page Coder Social logo

Comments (5)

SPSpwetter avatar SPSpwetter commented on June 9, 2024 2

I got it working by turning off injection and adding:

<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
<script src="<%= htmlWebpackPlugin.files.chunks[chunk].entry %>" 
    integrity = "<%= compilation.assets[chunk+"."+htmlWebpackPlugin.files.chunks[chunk].hash+".bundle.js"].integrity %>"></script>
<% } %>

To my html template. But its slightly hacky because I've hard coded the file structure of my bundle asset files names, so it won't work with other file patterns. I've filed an issue on html-webpack to see if we can get direct access to the file key here: jantimon/html-webpack-plugin#330

from webpack-subresource-integrity.

SPSpwetter avatar SPSpwetter commented on June 9, 2024 1

FYI, still working on this. html-webpack-plugin would rather a write a hook to modify the HTML after the fact. I'm open to that, but its a little downstream of where i would like to do it, so we're going back and forth.

from webpack-subresource-integrity.

SPSpwetter avatar SPSpwetter commented on June 9, 2024

Or with https://github.com/jaketrent/html-webpack-template?

from webpack-subresource-integrity.

jscheid avatar jscheid commented on June 9, 2024

Hi, currently there is no integration with these packages and since we're not using them, no plans to implement any at the moment.

It sounds like a good fit though so if you want to go ahead and build integration I'd be happy to merge. Perhaps using their event hooks?

from webpack-subresource-integrity.

SPSpwetter avatar SPSpwetter commented on June 9, 2024

Seems like it might be possible by tweaking their templates to pull the SRI info you're already creating? I may be working on this in a couple of weeks.

from webpack-subresource-integrity.

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.