(BUILD_CONFIG: BUILD_CONFIG_TYPE)
| 85 | } |
| 86 | |
| 87 | function getHTMLPluginOptions(BUILD_CONFIG: BUILD_CONFIG_TYPE) { |
| 88 | const publicPath = getPublicPath(BUILD_CONFIG); |
| 89 | const cdnOrigin = publicPath.startsWith('/') |
| 90 | ? undefined |
| 91 | : new URL(publicPath).origin; |
| 92 | |
| 93 | const templateParams = { |
| 94 | GIT_SHORT_SHA: gitShortHash(), |
| 95 | DESCRIPTION, |
| 96 | PRECONNECT: cdnOrigin |
| 97 | ? `<link rel="preconnect" href="${cdnOrigin}" />` |
| 98 | : '', |
| 99 | VIEWPORT_FIT: BUILD_CONFIG.isMobileEdition ? 'cover' : 'auto', |
| 100 | }; |
| 101 | |
| 102 | return { |
| 103 | template: currentDir.join('template.html').toString(), |
| 104 | inject: 'body', |
| 105 | minify: false, |
| 106 | templateParameters: templateParams, |
| 107 | chunks: ['app'], |
| 108 | scriptLoading: 'blocking', |
| 109 | } satisfies HTMLPlugin.Options; |
| 110 | } |
| 111 | |
| 112 | const AssetsManifestPlugin = { |
| 113 | apply(compiler: CompilerLike) { |
no test coverage detected