Build: Introduce webpack manifest plugin (#49798)

* build(webpack): introduce manifest plugin

* build(webpack): move manifest.json to root of project and git ignore
This commit is contained in:
Jack Westbrook
2022-08-30 11:18:55 +02:00
committed by GitHub
parent ef32050508
commit 5ea01dc9b9
4 changed files with 33 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
const { merge } = require('webpack-merge');
const HTMLWebpackCSSChunks = require('./plugins/HTMLWebpackCSSChunks');
@@ -81,6 +82,10 @@ module.exports = (env = {}) =>
chunksSortMode: 'none',
}),
new HTMLWebpackCSSChunks(),
new WebpackManifestPlugin({
fileName: path.join(process.cwd(), 'manifest.json'),
filter: (file) => !file.name.endsWith('.map'),
}),
function () {
this.hooks.done.tap('Done', function (stats) {
if (stats.compilation.errors && stats.compilation.errors.length) {