MCPcopy
hub / github.com/toeverything/AFFiNE / getHTMLPluginOptions

Function getHTMLPluginOptions

tools/cli/src/webpack/html-plugin.ts:87–110  ·  view source on GitHub ↗
(BUILD_CONFIG: BUILD_CONFIG_TYPE)

Source from the content-addressed store, hash-verified

85}
86
87function 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
112const AssetsManifestPlugin = {
113 apply(compiler: CompilerLike) {

Callers 1

createHTMLPluginsFunction · 0.85

Calls 3

getPublicPathFunction · 0.85
toStringMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected