Skip to content

Subresource Integrity with Webpacker 6 / Shakapacker #85

Closed Answered by tomdracz
ryanfb asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @ryanfb the cleanest way I can think of is removing the plugin from the default set before appending yours. Something along the lines of:

const { webpackConfig, merge } = require('shakapacker');
const WebpackAssetsManifest = require('webpack-assets-manifest');

const customConfig = {
  // your custom config
};

const filteredPlugins = webpackConfig.plugins.filter((plugin) => !(plugin instanceof WebpackAssetsManifest))
webpackConfig.plugins = filteredPlugins;

module.exports = merge(webpackConfig, customConfig);

The above should discard WebpackAssetsManifest plugin from the default list and after merge, you should have your own one there instead.

Think there might be other ways using …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Judahmeek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants