From 272c15ed39c11b7fe84e0544525b5cce9a6564f5 Mon Sep 17 00:00:00 2001 From: David Anson Date: Fri, 23 Jun 2023 03:36:07 +0000 Subject: [PATCH] Add name/version/homepage banner to markdownlint-micromark artifacts. --- micromark/package.json | 1 + micromark/webpack.config.js | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/micromark/package.json b/micromark/package.json index 120a1619..dcbf489e 100644 --- a/micromark/package.json +++ b/micromark/package.json @@ -23,6 +23,7 @@ "micromark-extension-gfm-autolink-literal": "1.0.5", "micromark-extension-gfm-footnote": "1.1.2", "micromark-extension-gfm-table": "1.0.7", + "terser-webpack-plugin": "5.3.9", "webpack": "5.88.0", "webpack-cli": "5.1.4" } diff --git a/micromark/webpack.config.js b/micromark/webpack.config.js index ecf405fd..3cc2c28b 100644 --- a/micromark/webpack.config.js +++ b/micromark/webpack.config.js @@ -2,6 +2,10 @@ "use strict"; +const webpack = require("webpack"); +const TerserPlugin = require("terser-webpack-plugin"); +const { name, version, homepage } = require("./package.json"); + const htmlEntry = "./exports-html.mjs"; const htmlName = "micromarkHtmlBrowser"; @@ -9,7 +13,12 @@ const base = { "entry": "./exports.mjs", "output": { "path": __dirname - } + }, + "plugins": [ + new webpack.BannerPlugin({ + "banner": `${name} ${version} ${homepage}` + }) + ] }; const commonjs = { @@ -36,7 +45,19 @@ const web = { }; const production = { - "mode": "production" + "mode": "production", + "optimization": { + "minimizer": [ + new TerserPlugin({ + "extractComments": false, + "terserOptions": { + "compress": { + "passes": 2 + } + } + }) + ] + } }; const development = {