87968: Remove html-webpack-plugin

After updating to Angular 12, it causes ng serve to fail with
  Conflict: Multiple assets emit different content to the same filename index.html

Confirmed that the application still builds and runs properly without it.

This plugin isn't used by @angular-builders/custom-webpack since Angular 8 (see https://www.justjeb.com/post/customizing-angular-cli-build#viewer-51npg), this is just the first time it's actually causing problems for us.

Removed script-ext-html-webpack-plugin as well since that's an extension to html-webpack-plugin & can't run without it.
This commit is contained in:
Yura Bondarenko
2022-02-24 18:45:43 +01:00
parent 22c5976095
commit 29d8dd68f4
3 changed files with 7 additions and 108 deletions

View File

@@ -2,8 +2,6 @@ import { globalCSSImports, projectRoot } from './helpers';
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ScriptExtPlugin = require('script-ext-html-webpack-plugin');
const sass = require('sass');
export const copyWebpackOptions = {
@@ -66,14 +64,6 @@ const SCSS_LOADERS = [
export const commonExports = {
plugins: [
new CopyWebpackPlugin(copyWebpackOptions),
new HtmlWebpackPlugin({
template: projectRoot('./src/index.html', ),
output: projectRoot('dist'),
inject: 'head'
}),
new ScriptExtPlugin({
defaultAttribute: 'defer'
})
],
module: {
rules: [