Minify a html string in a worker

I use a simple template in my worker, something like this:

export default function page(msg) {
  return (`
  <!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
<p> ${msg} </p>

and this is my index.js

import page from './page'

addEventListener('fetch', event => {

async function handleRequest(request) {
  const { pathname } = new URL(request.url)

  if (pathname === '/') {
    return new Response(page("hellow world"), {
      headers: { 'content-type': 'text/html' },

now when I set mode: 'production' in my webpack.cofing.js nothing happens, and my page response is not minified.
I just want to know is there any way to minify my HTML response?