Migrate shakapacker from 7.2.3 to 8.0.0

Bumps [shakapacker](https://github.com/shakacode/shakapacker) from 7.2.3 to 8.0.0.
- [Changelog](https://github.com/shakacode/shakapacker/blob/main/CHANGELOG.md)
- [Commits](https://github.com/shakacode/shakapacker/compare/v7.2.3...v8.0.0)

---
updated-dependencies:
- dependency-name: shakapacker
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2024-05-20 03:18:24 +00:00
committed by Dominic Sauer
parent db65562b57
commit 09fe592714
5 changed files with 27 additions and 102 deletions

View File

@ -1,6 +1,6 @@
// See the shakacode/shakapacker README and docs directory for advice on customizing your webpackConfig.
const { globalMutableWebpackConfig, generateWebpackConfig, config, merge } = require('shakapacker')
const { generateWebpackConfig, config, merge } = require('shakapacker')
const webpackConfig = generateWebpackConfig()
const CompressionPlugin = require("compression-webpack-plugin");
@ -88,8 +88,14 @@ const envConfig = module.exports = {
stats: 'minimal',
}
// Use the two lines below to remove the original WebpackAssetsManifest and replace it with our custom config.
const filteredPlugins = webpackConfig.plugins.filter((plugin) => !(plugin instanceof WebpackAssetsManifest))
globalMutableWebpackConfig.plugins = filteredPlugins;
module.exports = merge(globalMutableWebpackConfig, envConfig)
// Use the following lines below to remove original plugins and replace them with our custom config.
// This is especially needed for the `WebpackAssetsManifest` plugin, which would otherwise run twice.
const customPlugins = envConfig.plugins.map((plugin) => plugin.constructor.name);
const filteredDefaultPlugins = webpackConfig.plugins.filter((plugin) => {
return !customPlugins.includes(plugin.constructor.name);
});
webpackConfig.plugins = filteredDefaultPlugins;
// Create the resulting config by merging the (modified) default config and our custom setup
module.exports = merge(webpackConfig, envConfig)