From ce07097c38681e4a56255b5371e3367ac09a5bc5 Mon Sep 17 00:00:00 2001 From: Francesc Rosas Date: Mon, 22 Apr 2024 17:29:44 +0100 Subject: [PATCH] Remove the "build date" comment It adds avoidable complexity --- webpack.config.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 24ec98eb..df5e16ec 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,5 @@ /* eslint-env node */ -import webpack from "webpack" import CopyPlugin from "copy-webpack-plugin" import { CleanWebpackPlugin } from "clean-webpack-plugin" import HtmlPlugin from "html-webpack-plugin" @@ -11,10 +10,12 @@ const getBuildDate = () => new Date().toUTCString() const SERVICE_WORKER_ENTRY_NAME = "service-worker" -/** @type webpack.ConfigurationFactory */ +/** @type import('webpack').ConfigurationFactory */ const configFactory = (_, args) => { const isProd = args.mode === "production" || !args.mode - const createOutputFilename = (/** @type webpack.ChunkData */ chunkData) => + const createOutputFilename = ( + /** @type import('webpack').ChunkData */ chunkData, + ) => `scripts/[name]${ // In dev we don't need to hash the URL (TODO does it do any harm though?), // and not having a consistent service worker URL caused problems (TODO which?) @@ -56,11 +57,6 @@ const configFactory = (_, args) => { plugins: [ new CleanWebpackPlugin(), new CopyPlugin({ patterns: [{ from: "static" }] }), - new webpack.BannerPlugin({ - // TODO Submit fix for banner type not accepting functions - /** @type {any} */ - banner: () => `Build date: ${getBuildDate()}`, - }), new HtmlPlugin({ template: "html/index.ejs", templateData: { getBuildDate, renderOfflineSupport },