waysact / webpack-subresource-integrity

Webpack plugin for enabling Subresource Integrity.
MIT License
356 stars 46 forks source link

Unresolved integrity placeholders #230

Open combmag opened 7 months ago

combmag commented 7 months ago

Hi,

I am trying to implement this webpack plugin for our nx angular app. I added a new webpack.config.json as seen below

const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
const { SubresourceIntegrityPlugin } = require('webpack-subresource-integrity');
const {
    shareAll,
    } = require('@angular-architects/module-federation/webpack');

module.exports = {
    output: {
        publicPath: 'auto',
        uniqueName: 'angular3',
        scriptType: 'text/javascript',
        crossOriginLoading: "anonymous"
    },
    stats: "detailed",
    optimization: {
        runtimeChunk: false,
    },
    plugins: [
        new ModuleFederationPlugin({
            // For remotes (please adjust)
            name: 'angular3',
            library: { type: 'var', name: 'angular3' },
            filename: 'remoteEntry.js',
            exposes: {
                './webcomponents': 'apps/site/src/bootstrap.ts',
            },

            // For hosts (please adjust)
            /*
      remotes: {
          'mfe1': "mfe1@http://localhost:3000/remoteEntry.js" 
      },
      */

            shared: {
                ...shareAll({
                    singleton: true,
                    strictVersion: true,
                    requiredVersion: 'auto',
                }),
            },
        }),
        new SubresourceIntegrityPlugin({
            hashFuncNames: ['sha256', 'sha384'],
            enabled: true,
        }),
    ],
};

But i am getting Error: webpack-subresource-integrity: Asset main.4eabbc3c8909fb56.js contains unresolved integrity placeholders without any info it's making it really hard to debug.

coharishkumarreddy commented 3 months ago

I am also facing same issue, Any update on this?