<%= (function () { // This code emits additional `link rel="preload"` tags for edit.html and view.html. // This helps to load edit and view modes faster. // // If you code-split some code and need to preload it as well, here’s how to do that: // 1) Give your import a name (use the `webpackChunkName` comment: `import(/* webpackChunkName: "my-name" */ "./my-file")`) // 2) Add the name into the `chunksToPreload` array below let chunksToPreload = []; if (htmlWebpackPlugin.options.appsmithHtmlTarget === 'edit-mode') { chunksToPreload = [ ...compilation.namedChunkGroups.get("editor").chunks, ...compilation.namedChunkGroups.get("global-search").chunks, ] } else if (htmlWebpackPlugin.options.appsmithHtmlTarget === 'view-mode') { chunksToPreload = [...compilation.namedChunkGroups.get("AppViewer").chunks] } return chunksToPreload.flatMap(i => [...i.files]) .map(url => ``) .join('\n') function getPreloadValueForFile(fileName) { if (fileName.endsWith('.js')) { return 'script'; } else if (fileName.endsWith('.css')) { return 'style'; } throw new Error(`Unknown preload type for file: ${fileName}`); } })() %>