Skip to content

Commit

Permalink
Remove the "build date" comment
Browse files Browse the repository at this point in the history
It adds avoidable complexity
  • Loading branch information
frosas committed Apr 22, 2024
1 parent 5c1f5d9 commit ce07097
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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?)
Expand Down Expand Up @@ -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 },
Expand Down

0 comments on commit ce07097

Please sign in to comment.