async function buildFeModule() {
    const entryPoint = `${feModuleSrc}/uibuilder.module.mjs`
    const fileContent = await fs.readFile(entryPoint, 'utf8')
    const v = fileContent.match(/const version = '(.*)-src'/)
    if (v[1] !== release) {
        console.warn(`WARNING: Version in ${entryPoint} does not match requested release version. Expected '${release}-src' but found '${v[1]}-src'.`)
        // await fs.writeFile(entryPoint, fileContent.replace(/const version = '(.*)-src'/, `const version = '${release}-src'`), 'utf8')
    }

    try { // IIFE minified
        const outFilePath = `${feDest}/uibuilder.iife.min.js`
        await esbuild.build({
            entryPoints: [entryPoint],
            outfile: outFilePath,
            bundle: true,
            format: 'iife',
            platform: 'browser',
            minify: true,
            sourcemap: true,
            loader: {
                '.mjs': 'js',
            },
            target: [
                // 'es2019',
                // Start of 2019
                'chrome72',
                'safari12.1',
                'firefox65',
                'opera58',

                // For private class fields:
                // 'chrome74',   // Apr 23, 2019
                // 'opera62',    // Jun 27, 2019
                // 'edge79',     // Jan 15, 2020
                // 'safari14.1', // Apr 26, 2021
                // 'firefox90',  // Jul 13, 2021

                // If we need top-level await
                // 'chrome89',  // March 1, 2021
                // 'edge89',
                // 'opera75',   // Mar 24, 2021
                // 'firefox89', // Jun 1, 2021
                // 'safari15',  // Sep 20, 2021
            ],
        })
        // Update the output version string if build was successful
        const fileContent = await fs.readFile(outFilePath, 'utf8')
        await fs.writeFile(outFilePath, fileContent.replace(/version = "(.*)-src"/, 'version = "$1-iife.min"'), 'utf8')
    } catch (e) {
        throw new Error(`UIB Library IIFE (minimised) Build failed. ${e.message}`)
    }
    try { // IIFE not-minified
        const outFilePath = `${feDest}/uibuilder.iife.js`
        await esbuild.build({
            entryPoints: [entryPoint],
            outfile: outFilePath,
            bundle: true,
            format: 'iife',
            platform: 'browser',
            minify: false,
            sourcemap: false,
            loader: {
                '.mjs': 'js',
            },
            target: [
                // 'es2019',
                // Start of 2019
                'chrome72',
                'safari12.1',
                'firefox65',
                'opera58',

                // For private class fields:
                // 'chrome74',   // Apr 23, 2019
                // 'opera62',    // Jun 27, 2019
                // 'edge79',     // Jan 15, 2020
                // 'safari14.1', // Apr 26, 2021
                // 'firefox90',  // Jul 13, 2021

                // If we need top-level await
                // 'chrome89',  // March 1, 2021
                // 'edge89',
                // 'opera75',   // Mar 24, 2021
                // 'firefox89', // Jun 1, 2021
                // 'safari15',  // Sep 20, 2021
            ],
        })
        // Update the output version string if build was successful
        const fileContent = await fs.readFile(outFilePath, 'utf8')
        await fs.writeFile(outFilePath, fileContent.replace(/version = "(.*)-src"/, 'version = "$1-iife"'), 'utf8')
    } catch (e) {
        throw new Error(`UIB Library IIFE (unminified) Build failed. ${e.message}`)
    }

    try { // ESM minified
        const outFilePath = `${feDest}/uibuilder.esm.min.js`
        await esbuild.build({
            entryPoints: [entryPoint],
            outfile: outFilePath,
            bundle: true,
            format: 'esm',
            platform: 'browser',
            minify: true,
            sourcemap: true,
            loader: {
                '.mjs': 'js',
            },
            target: [
                // 'es2019',
                // Start of 2019
                'chrome72',
                'safari12.1',
                'firefox65',
                'opera58',

                // For private class fields:
                // 'chrome74',   // Apr 23, 2019
                // 'opera62',    // Jun 27, 2019
                // 'edge79',     // Jan 15, 2020
                // 'safari14.1', // Apr 26, 2021
                // 'firefox90',  // Jul 13, 2021

                // If we need top-level await
                // 'chrome89',  // March 1, 2021
                // 'edge89',
                // 'opera75',   // Mar 24, 2021
                // 'firefox89', // Jun 1, 2021
                // 'safari15',  // Sep 20, 2021
            ],
        })
        // Update the output version string if build was successful
        const fileContent = await fs.readFile(outFilePath, 'utf8')
        await fs.writeFile(outFilePath, fileContent.replace(/version = "(.*)-src"/, 'version = "$1-esm.min"'), 'utf8')
    } catch (e) {
        throw new Error(`UIB Library ESM (minified) Build failed. ${e.message}`)
    }
    try { // ESM not-minified
        const outFilePath = `${feDest}/uibuilder.esm.js`
        await esbuild.build({
            entryPoints: [entryPoint],
            outfile: outFilePath,
            bundle: true,
            format: 'esm',
            platform: 'browser',
            minify: false,
            sourcemap: false,
            loader: {
                '.mjs': 'js',
            },
            target: [
                // 'es2019',
                // Start of 2019
                'chrome72',
                'safari12.1',
                'firefox65',
                'opera58',

                // For private class fields:
                // 'chrome74',   // Apr 23, 2019
                // 'opera62',    // Jun 27, 2019
                // 'edge79',     // Jan 15, 2020
                // 'safari14.1', // Apr 26, 2021
                // 'firefox90',  // Jul 13, 2021

                // If we need top-level await
                // 'chrome89',  // March 1, 2021
                // 'edge89',
                // 'opera75',   // Mar 24, 2021
                // 'firefox89', // Jun 1, 2021
                // 'safari15',  // Sep 20, 2021
            ],
        })
        // Update the output version string if build was successful
        const fileContent = await fs.readFile(outFilePath, 'utf8')
        await fs.writeFile(outFilePath, fileContent.replace(/version = "(.*)-src"/, 'version = "$1-esm"'), 'utf8')
    } catch (e) {
        throw new Error(`UIB Library ESM (unminified) Build failed. ${e.message}`)
    }
}
Build front-end module in various output formats using esbuild
@throws {Error} If build fails